Mail Archives: cygwin/1998/08/20/17:41:58
I am learning C++, and have the 1997 Stroustrup book. My compiler
(gcc 2.7.2.3) warns on Stroustrup's code
that namespaces are broken in that release of gcc. As in:
#include <iostream>
using namespace std;
int main(void)
{
cout << blah << endl;
return(0);
}
Does egcs support namespaces?
Also... I can reassign string constants?! Here:
$ make stringy
g++ -O -pedantic -Wall -ansi stringy.C /usr/lib/libstdc++.a -o
stringy
stringy.C: In function `int main()':
stringy.C:7: warning: ANSI C++ forbids assignment of arrays
[allan AT scooby allan]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/specs
gcc version 2.7.2.3
[allan AT scooby allan]$ cat stringy.C
#include<iostream.h>
int main(void)
{
char datarr[5]="bits";
cout << datarr << endl;
datarr = "byte";
cout << datarr << endl;
return(0);
}
[allan AT scooby allan]$
At worst generates a warning with -ansi -Wall -pedantic
Why?
Thanks
Allan
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -