I'm new to c++ & I've this big confusion around c++ & g++ versions. I've come to understand that there are different version of g++ compiler, latest being 4.8 (i think). But then I see c++98 & c++11 mentioned at so many places. Are these two versioning systems for the same thing or is it for totally different things? And if they are different, how can I check if I'm using c++98 or c++11? Thanks!
-
1g++ versions are versions of the compiler. c++ 'versions' such as c++11 are standards. Newer standards would require a more recent version of the compiler to recognize the new standard. To compile the C++11 standard you will need to use the -std=c++11 flag for g++– Brandon HastonCommented Oct 26, 2013 at 4:10
Add a comment
|
1 Answer
C++98 and C++11 are standards rather than compilers. They are issued by ISO and compilers are expected to implement the features as given in the standards.
The g++ compiler is one that provides (as of 4.8 anyway) most of the features from the c++11 standard, as you can see here.