How to compile c++ 11 program on Linux
How to compile c++ 11 program on Linux. C++ 11 programs can not be compiled the way we compile C++ program (older than c++11). Let see how c++11 program is compiled on Linux terminal with g++ compiler. Let us write a very simple c++ 11 program.
// Specifies that the type of the variable that
//is being declared will be automatically
// deduced from its initializer
auto a = 3;
Open terminal and compile program ( run below command , assuming the above program is saved as main.cpp)
#g++ -std=c++11 main.cpp -o main