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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux