This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]