What about Virtual Destructor? What is Pure Virtual Function? Why and when it is used ? i m new to this.please answer if u can.
Yes there is a Virtual Destructor. A destructor can be virtual as it is possible as at runtime depending on the type of object pointer is pointing to , proper destructor will be called. i dont know pure virtual function.
The abstract class whose pure virtual method has to be implemented by all the classes which derive on these. Otherwise it would result in a compilation error.
A pure virtual function does not work at all - it is by definition defined as a a header only, with zero assigned to indicate this to the compiler (and developer). The effect is that you are unable to create an instance of a class which contains a pure virtual function, and such a class is refered to as abstract. The use of such a class is as a base class which defines the common functionality which descendant classes must implement if they are to be instanciated. This is all i got abt pure virtual function.