Hello,
I have a class with a vector as a static member:
I then wish to initialize the vector in the .cpp file in global scope:Code:class MyClass { static std::vector<int> my_vector; }
But this gives me some errors. How can I initialize the values of my_vector? Thanks.Code:std::vector<int> my_vector = std::vector<int>(10); my_vector[0] = 5;




Reply With Quote