Hi
If I understand, you have something like
vector<int> *MyVec;
assuming the pointer is correctly allocated and there is data in...
to access an element you can use at() function. at() simply return the
element at the specified position but
with a range check. If you dont mind the overhead of a range check use it.
int elem = MyVec->at(0); // the first element
MyVec->at(0) = 5;
if you really want to use [] you can do
int elem = (*Myvec)[0];
(*Myvec)[0] = 5;
Eric
"Si" <si@hotmail.com> a écrit dans le message de news:
tq*****************@newsfe2-gui.ntli.net...
How do I access the contents of an std:vector pointer (I mean access
contents of the vector)?
What is the correct notation for a pointer ( [index] doesn't seem to
work)?