hello again, i've started looking at STL lists for the first time. I'm starting an exercise i found on this web site about mutant bunnies that breed(good exercise actually..)! .
Anyway, i would like to store my bunny objects to a list( i considered vectors, but i think lists would be better as i have to insert and delete perhaps in the middle of the list?). What i would like to know is, how i access the members of the mutantType when they are stored in list? See my attempt below which doesn't work!!!. printSummary() is a member of mutantType class.
std::list <mutantType*> bunnyList;
bunnyList.push_front( new mutantType );
bunnyList.push_front( new mutantType );
bunnyList.push_front( new mutantType );
bunnyList.push_front( new mutantType );
Don't forget that you store pointers in your list -> std::list <mutantType*> bunnyList;
This means you need two derefernce operations, one for the iterator and one for the pointer.