I guess you are doing sth like this
Originally Posted by Asagohan
Since the list items holds only item's push_back will only store the item-part of the apple's and bananas. ( this is called slicing ).
you have to do it this way;
apple * pa= new apple;
banana * pb= new banana;
for ( list<item*>::iterater i = items.begin(); i != items.end(); ++i )