Hi,
I have a program, which uses a vector to store some pointers.
The program works fine.
I'm trying to convert it to use a doubly linked list now though.
At the top of the program I changed:
toCode:vector<Diary *>vectorname;
Later on in the program I access an element of the (former) vector using:Code:#include <list> list<Diary *>vectorname; list<Diary*>::iterator i = vectorname.begin();
Code:if(vectorname[a]->getName() == leadToDelete)
And use:
instead.Code:if(advance(i,a)->getName() == leadToDelete) { //do something }
BUt when I try it fails to compile, saying:
I was hoping this would be a simple way to do the conversion, but I have made a mistake in the code above it seems.error C2227: left of '->getName' must point to class/struct/union/generic type
Could anyone show me how I do this?
Many thanks for any help!



LinkBack URL
About LinkBacks




