2. If show is called from Derived, it is giving priority to Derived variable. (Variable in Base is hidden by variable of Derived)
This is wrong, it still uses the Base class' s. Change your code so it uses a Derived object reference instead of a Base object reference and you will see it still prints "Base".
There, I changed it for you. Output:
Mike has explained it in a more formal detailed way, it's very important to understand what's happening. So play with your code, use a debugger, or whatever to convince yourself of what is going on.

[ December 04, 2004: Message edited by: Barry Gaunt ]