remember the rule
sometimes its hard to figure out which method is called when looking at a hierarchy of classes, which use virtual specifier for their methods. but, as always, if you know how the things works internally, you will always find the right answer. I always think that instead of remembering 10 specific cases (which it might not be hard at all for many people, but me for example, I have a bad memory) its much easier to remember 1 thing only, how it works. this is a case for the virtual specifier. the thumb rule is this (this is from MSDN): When calling a function using pointers or references, the following rules apply: 1.A call to a virtual function is resolved according to the underlying type of object for which it is called. 2.A call to a nonvirtual function is resolved according to the type of the pointer or reference. but this rule might not be always simple to apply. What is really good is to know why the things are happing like described in those 2 rules. Let's take each of them: 1....