‘’

error : in c++98 ‘v’ must be initialized by constructor, not by ‘{….}’

Hey there! Have you ever used c++STL in CodeBlocks? As I have noted, if you used below example code of vector in c++STL, after that you might face the error something like this

error : in c++98  ‘v’ must be initialized by constructor, not by  ‘{….}’

error: could not convert  ‘{1,4,6,8,10}’ from ‘<brace-enclosed initialize list>’ to ‘std::vector<int>’

vector c11

you can use the following steps to remove the error

  1. Go to CodeBlocks toolbar –> settings –> compiler
  2. Select option[Have g++ follow the c++ ISO c++ language standard[-std=c++11]
  3. Press ok
-std=c++11

Mohammed Anees

Hey there, welcome to aneescraftsmanship I’m Mohammed Anees an independent developer/blogger.

Leave a Reply

Your email address will not be published.