Linux下编译c++

c++98

g++ -o 可执行文件名   文件名.cpp

当出现如下报错信息的时候,请使用c++11版本的编译

in C++98 ‘arr’ must be initialized by constructor, not by ‘{...}’      
vector<int>arr={ 0, 13, 24, 35, 46, 57, 60, 72, 87};

c++11

g++ -std=c++11 文件名.cpp -o 可执行文件名

猜你喜欢

转载自blog.csdn.net/qq_29996285/article/details/84670488