View Single Post
Old 04-15-2013, 02:55 PM   #50
Reincarnate
x'); DROP TABLE FFR;--
Retired StaffFFR Veteran
 
Reincarnate's Avatar
 
Join Date: Nov 2010
Posts: 6,332
Default Re: Teach me CS stuff for interviews

So I could say "Animal* kitty = new Cat()" but what I am saying is that why couldn't I just do "Cat kitty = new Cat()" where Cat inherits Animal, and then when I call kitty.make_sound(), it calls the Animal's make_sound() function using the data attributes of the Cat() object?
Reincarnate is offline   Reply With Quote