I've only been coding in C++ for three months, but there's one thing I've learned the hard way:
Always apply good coding practices when programming in C or C++, otherwise you're in for trouble later on. C/C++ does whatever you tell it, even if it's blatantly fubard code.
Examples:
FLOAT fX = 1.25;
DWORD dwX = (DWORD) fX;
This one caused me quite a few problems and took me a while to figure out
#define FunMacro(x) x / 2;
// Somewhere in your code..
FunMacro(5 + 233);
Yet one reason why macros should be avoided, because errors are so easy to make with them if they aren't properly handled
So many things can happen, it's endless. Be careful.
As for your particular virtual fun, I do believe the class inherited from must have virtual in front of the function if you want polymorphism to take effect. If you don't define a function as virtual in one of the derived classes, then the buck stops there, and fun things begin to happen.
