linux编译不通过

 c++中使用vector类时 vector nums={a ,b ,c ,d}编译g++ xx.cpp -o xx报错

 error: in C++98 ‘nums’ must be initialized by constructor, not by ‘{...}

应改为g++ -std=c++11 xx.cpp -o xx 或者g++ -std=gnu++11 xx.cpp -o xx

你可能感兴趣的:(linux)