I have a particular scenario below. The code below should print \'say()\' function of B and C class and print \'B says..\' and \'C says...\' but it doesn\'t .Any ideas.. I a
list::iterator it; B bObj; C cObj; A *aB = &bObj; A *aC = &cObj; listOfAs.insert(it,*aB);
Do you not need to initialize "it" ? I believe you should do it = listOfAs.begin(); before starting to insert.