C++: Overriding in inheritance.