C++ code compilation problem - issues with difference in standards

Anticipating a Reply ruxyz@yahoo.com
Wed Sep 10 11:55:00 GMT 2003


Hi,

I 'am getting compilation errors when I try to compile
the below c++ sample code , using g++ version 3.2 .

   By referring to the below link , I found a
workaround .

http://www.cs.odu.edu/~zeil/cs361/Lectures-f02/00faq/faq/backwardsHeaders.html#backwardsHeaders

   When  I  include line number 9 as part of the code
( i.e. uncomment it ),the compilation goes through
fine .

    I would like to know if there is a better approach
to resolve this issue ? Are there any compilation
flags which allows this to compile without errors ?  


Regards

-------------------------------------------------------------------------------------

     1 #include <iostream>
      2
      3 #include <string>
      4
      5 int main() {
      6
      7   char second[]=" WORLD !";
      8
      9  //using namespace std;
     10   string mesg = "HELLO" + (string)second;
     11
     12   cout << mesg << endl;
     13
     14   return 0;
     15
     16 }

----------------------------------------------------------------------------




________________________________________________________________________
Yahoo! India Matrimony: Find your partner online.
Go to http://yahoo.shaadi.com



More information about the Gcc-help mailing list