J
JackC
Hi,
If i have a std::vector containing pointers, then iterate through the
vector and im slightly confused as to how i use the item from the
iterator?
for example,
vector<MyClass*> myvector;
....
vector<MyClass*>::iterator it;
for(it = myvector.begin(); it < myvector.end(); it++)
{
// This doesn't work,
**it->myclassmember();
}
What am i doing wrong? I thought the iterator is a pointer to a
pointer in this case?
Thanks alot for any help,
If i have a std::vector containing pointers, then iterate through the
vector and im slightly confused as to how i use the item from the
iterator?
for example,
vector<MyClass*> myvector;
....
vector<MyClass*>::iterator it;
for(it = myvector.begin(); it < myvector.end(); it++)
{
// This doesn't work,
**it->myclassmember();
}
What am i doing wrong? I thought the iterator is a pointer to a
pointer in this case?
Thanks alot for any help,