In reply to Srini @ CVCblr.com:
Thanks for the reply Srini. I am Prasad by the way.
I tested the code to print variable C and it works. Using virtual functions one can access new members of derived classes. But one cannot directly access like P1.C ! I fail to understand why?
What exactly happens when we do upcasting using the following statement?
P1=P2?
I thought it would be a simple copy of everything in P1 from P2. It does not seem to be the case.
Thanks
Prasad.