The syntax of accessing of an element of the vector is correct. It is incorrect the syntax of allocating new object of type MyClass. Should be
MyClass *example = new MyClass; // or MyClass()
Last edited on
So if I have a constructor in the class:
Myclass(int a, string b, int c);
I would do the operation like this?
data.at(2).at(2).a = Myclass(1, abc, 2);
data.at(2).at(2).a = new Myclass(1, abc, 2);
Oh right, forgot about the new. Thanks.