I've been trying to make a 2-d vector that would be a 10x10 and i could fill the vector(called nest) so that one of the indices could have more components than another other indices. But when i create the vector it makes every value in it zero. Here's my code
I understand that you want to create a 10x10 table, and each cell in the table is just a place holder, no any object is created at this moment. But it's impossible to directly use vector to do it. As long as you specify a size to a vector, then the vector creates objects right away, and each object is initialized with proper value. You need to define something like wrapper or referencer to approach your goal.
For example, if you define "vector<MyClass> aaa(2);", then aaa will contain 2 objects of MyClass, this means aaa is not empty because it has 2 objects already.
if you define "vector<MyClass*> bbb(2);", then bbb will contains 2 objects of "MyClass*", but not objects of MyClass, the default value for pointer here is NULL. Now bbb's size is 2, bbb is "a sort of empty" for object of MyClass. Here MyClass* is a referencer of MyClass.