Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

iterators

Name: Anonymous 2009-12-12 22:32

Hello.
In C++, I'm using an iterator to iterate through a vector of pointers.
How do I perform operations on the iterator?
I've tried several things but keep getting errors. This is where I get the error:

//In constructor of interface class
d_ClassA.push_back(new Class B(3)); //d_ClassA is a..                                     //std::vector<ClassA*>
...

//member-function in interface class
...
for (vector<ClassA*>::iterator i = 0; i != d_ClassA.end(); i++) {
    string classAFilename= (*i)->getFilename();
...

I guess there could be something else that is wrong. But is the code above correct?

Name: sage 2009-12-12 23:07

keep getting errors
not posting the error message
9.5/10

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List