Converting a program. From Vector to List
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:
Later on in the program I access an element of the (former) vector using:
list<Diary*>::iterator i = vectorname.begin();
if(vectorname[a]->getName() == leadToDelete)
if(advance(i,a)->getName() == leadToDelete)
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!