C++中,vector的初始化出错,怎么解决!

我就不介绍vector的六种初始化的方法了,网上一大把,但是在利用CodeBlock编写C++程序时;

出现了   error: in C++98 'vecDouble' must be initialized by constructor, not by '{...}'|   ,就是这个错误!

在codeblock中,打开setting,找到compiler,在compiler flags中,

找到并勾选上   have g++ follow the C++ 11 ISO C++ language standard    。

就可以了》》》》》》》

 

posted @ 2020-03-08 21:29  gaofenzi  阅读(1269)  评论(0)    收藏  举报