hi all,
i have a bit of a problem with pointers to vector. I have a map
now I can access all the vectors trough commands like children[i]->begin().
the question is how do I gain random acces to an element of a vector to edit the value?
I have tried *(children[i])[j] = 5; but this gives me a error C2100: illegal indirection
I have tried other options but these are just wrong. I know I can evade the problem by using iterators, but I use rather large vectors so this is not optimal.
cheers,
stefaan
i have a bit of a problem with pointers to vector. I have a map
Code:
map<int , vector<int> * > children;
the question is how do I gain random acces to an element of a vector to edit the value?
I have tried *(children[i])[j] = 5; but this gives me a error C2100: illegal indirection
I have tried other options but these are just wrong. I know I can evade the problem by using iterators, but I use rather large vectors so this is not optimal.
cheers,
stefaan
Comment