May 2012
Intermediate to advanced
679 pages
16h 56m
English
Consider a situation where a compiler is compiling a program and see a base class pointer pointing to a method declared virtual. Compiler knows that base class pointer can point to derived class object. It does not know where it is pointing at this instant. When the program is running and execution comes to this point, it is possible to decide where base class or derived class method should be executed. Therefore, the compiler postpones the decision. It is taken at runtime. Therefore, such a polymorphism is known as run time polymorphism. Let us see a concrete example.
Program: Write a program to show that when base class pointer point to the derived class, method from the derived ...
Read now
Unlock full access