I am a beginner in c++ and every time I run vector<int> nums = {2, 5, 3, 7, 1}; it gives me the Error: non-arregrate type vector cannot be initialized with initializer list.
vector<int> nums = {2, 5, 3, 7, 1};
Can you tell me why?
Thanks,
Use g++ -std=c++11 <filename> when compiling.
g++ -std=c++11 <filename>
2.1m questions
2.1m answers
60 comments
57.0k users