
22 Oct
2009
22 Oct
'09
6:05 a.m.
Hi, On Thu, Oct 22, 2009 at 12:08 PM, Ireneusz Szpilewski <irek@szpilewski.opole.pl> wrote:
What if MyHeart has SingMySong() method while Heart does not? How can I access it?
Since we are on the topic of RTTI, you could just use say, dynamic_cast to convert the Heart* to a MyHeart* and thus call SingMySong(). On the other hand, maybe Heart should have such a virtual function instead, if it is supposed to be used polymorphically. Regards, Eugene