Pointer of type Vector

Is is there any way to create pointer of type vector that stores references to other vectors ? Also I want to dynamically create vectors. Any help will be appreciated.
Is is there any way to create pointer of type vector
Like every other pointer...
vector that stores references to other vectors
It is not possible to store references in containers. However you can store pointers, or use class reference_wrapper.

Also I want to dynamically create vectors
What the problem is?
ok. I have inputs that are generated dynamically, lets say if input string is "3 4 1", I want a vector that stores 3 vectors , first vectors will have 3 vectors second will have 4 and last one will have 1.
Why are you need pointers for that?
Do I read this correctly? You want a vector which stores vectors which stores another vectors... of what?
The fact that you believe that all three dimensions of your array have to be dynamically allocated screams poor design to me. So let's start over again from the beginning, like MiiNiPaa has been trying to get you to do from his first post, what problem are you trying to address with this probable dead-end solution?

If you plan on storing a large dynamic table of large dynamic tables, like dimension tables for instance, or anything like that then this is not the direction that you want to go at all. Vectors keep the data they contain contiguous, and in order to facilitate that they completely reallocate themselves when they run out of room. Now normally, with the intended use of vectors, this has such a miniscule impact on performance that it is rarely worth mentioning or even considering for the most part. But with what you are trying to do every reallocation that you trigger has the potential to trigger a reallocation of it's parent container as well. With only the evidence in front of me, I'm going to go ahead and speculate that you are using the wrong tool for this job OP.
Last edited on
MiiNiPaa are you asking about type of values stored in vector ?
Topic archived. No new replies allowed.