I have already seen this question several times but it keeps giving me the same error. The error:non-arregrate type vector cannot be initialised with initializer list, repeats itself every time I try to create a vector in the following way:
`#include <vector>
using std::vector;
int main(){
vector<int> numbers = {10, 20, 30};
return 0;
}
`
I tried to write also:
`std::vector<int> numbers {10, 20, 30};`
but gave me still the same error.
Then I checked some tutorials on-line and I tried to modified tasks.json adding “-std=c++17”,
“-stdlib=libc++” in args: but still same error.
What should I try now?
Thank you.
Ettore Franzè is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.