View Single Post
Old 04-15-2013, 02:25 PM   #45
FissionMailed1
FFR Player
 
FissionMailed1's Avatar
 
Join Date: Feb 2012
Location: Massachusetts
Age: 30
Posts: 1,230
Send a message via Skype™ to FissionMailed1
Default Re: Teach me CS stuff for interviews

Quote:
Originally Posted by Reincarnate View Post
Sorry I am at work at the moment so I'm reading these posts at light speed, so I may be asking dumb questions here.

Does this polymorphism concept only apply to iteration? For instance if I instantiated a Cat inheriting from Animal and simply called make_sound() from it, which one does it invoke? What differentiates whether I call animal's make_sound() or the cat's?
No, polymorphism doesn't apply to just iteration. I think it is the best example to explain it though, so that's why I used it. In regards to which make_sound() is called, it depends on whether make_sound in Animal is virtual or pure virtual. If it is either one, Cat's make_sound() will always be called. If make_sound() is not virtual, then the make_sound() that is called depends on the type that was initially declare, or if Cat declared make_sound() at all. For example:

Animal generic_animal = new Animal();
Cat generic_cat = new Cat();

generic_animal.make_sound();
generic_cat.make_sound();

This will behave exactly as you expect it to behave, and generic_animal's make_sound() will be called, followed by generic_cat's make_sound().
__________________


YOUR THROBBING MULTIFARIOUS LUSTFUL DESIRES ARE COMPLETED N YOUR HYPER-ORANGE SELF, YOU MAKE ME LOVE AGAIN, YOU'VE CHANGED MY HEART, MY MELANCHOLIA DISAPPEARS WHEN YOU ARE INSIDE OF ME, MY HUMAN RAGE IS TEMPERED WHEN I AM INSIDE YOU, THE SECRET IS COMMUNICATION, LONGEVITY, STAMINA, REPETITION, FURY, SOULFUL KISSING, EARPLUGS. YOU FUCKING CORPORATE COCKS AND CUNTS.

MY ANXIETY COMPLETE, MY DESIRE REPLETE, THE TASTE OF ORANGE BLOOD AND CUM AND GREENBACKS RUNNING DOWN MY FACE. THE STREETS WILL RUN ORANGE WITH YOUR MIXTURE OF CHEETOS AND HUNDRED DOLLAR BILLS REGURGITATED AND EATEN AND SHIT OUT AGAIN AND EATEN AGAIN.

YOU ARE MY SCULPTURE, MY SCULPTRA, MY SELF-DEFINITION. MY DEFINITION OF HUMANITY, MY HARMONY. MY HEART AND MY MIND.

YOU ARE SO ORANGE. SO CRUNCHY. SO CONSUMABLE.

THE NEW ORANGE UNDERGROUND IS THE ORANGE UP MY ASS. AND YOUR ASS.

I LOVE YOU CHEETOS.
FissionMailed1 is offline   Reply With Quote