Howdy,
I am creating a dynamic 2D data structure. I am using vectors (unless i find a better option). I am also new to the STL.
I also am using the personal edition of C++ Builder 6.
How can i declare and manipulate a vector of a vector?
can i declare a vector of a vector like this ?
vector <vector<ElemType>> Element;
How would i manipulate this list? especially, how can i specify to add/remove Element on Row X, Column Y.
I am not supposed to have memory reserved for every row, just where it is needed. We are looking for a reasonably efficent way of doing this, but we need to use the STL.
this might be an example of the data structure, using E as a vector element:
E-E-E
|
E
|
E-E
|
E-E-E-E-E-E-E
|
E-E-E-E
Thanks In Advance,
Tom
I am creating a dynamic 2D data structure. I am using vectors (unless i find a better option). I am also new to the STL.
I also am using the personal edition of C++ Builder 6.
How can i declare and manipulate a vector of a vector?
can i declare a vector of a vector like this ?
vector <vector<ElemType>> Element;
How would i manipulate this list? especially, how can i specify to add/remove Element on Row X, Column Y.
I am not supposed to have memory reserved for every row, just where it is needed. We are looking for a reasonably efficent way of doing this, but we need to use the STL.
this might be an example of the data structure, using E as a vector element:
E-E-E
|
E
|
E-E
|
E-E-E-E-E-E-E
|
E-E-E-E
Thanks In Advance,
Tom