gcc/g++ 3.0.3 namespace problem

Ukrit Visitkitjakarn visiukr@usa.net
Wed Feb 13 10:06:00 GMT 2002


Dear all,

First, I'd like to thank John and Kayvan for helping me fix the problem in my
cpp code, which was caused by improper use of namespace.

The test code that I used is listed below for reference.

test.cpp:
#include <string>
#include <stdio.h>
int main() {
  string a;
  a="test";
  printf ( "test message: %s", a.c_str());
  return 0;
}

John and Kayvan suggested using 'using namespace std;' to make this test code
compiled.  I tested it and it works.  

Now I ran into the problem where I have almost 50 files to change (inserting
'using namespace std;'.)  

Is there any gcc/g++ switch/flag that I can use so that I can compile the test
code without using 'using namespace std;' ?   

** Please reply to my email address, I am not in the gcc mailing list **

Thanks you very very much

Ukrit 


____________________________________________________________________
Get free e-mail and a permanent address at http://www.amexmail.com/?A=1


More information about the Gcc-help mailing list