Checking C ++ version on my laptop

Now I am in the CS class, where we use C ++, and I am running Linux on my laptop. So the problem is that I think I do not have the latest version of C ++. I read online for several teams to get the version, and this is my result. Also my version of Linux is 16.04 and I am compiling in my terminal

tom@TBT-XPS-13-9360 :~/Documents/Subjects/CS/OOP$ g++ --version g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

I don't know how much of this is my real version of C ++. If my version is not the most current, can someone please give me DETAILED instructions on how to do this. Still getting my Linux legs.

+5
source share
1 answer

The C ++ version (or commonly called the C ++ standard) is different from the compiler version.

g++ is your compiler, and your current version is g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

You can use another command to compile your program using a different version of C ++.

 g++ -std=c++11 yourFile ..... g++ -std=c++14 yourFile ..... 

As mentioned in the comments, this version of the compiler may not yet support C ++ functions 17

+10
source

Source: https://habr.com/ru/post/1272169/


All Articles