In inheritance if the base class contains a virtual function equating to zero, it is known also as do-nothing function & that base class is called as abstract base class as there are no instances or objects can be created by this base class. And this pure virtual can be filled with the codes in successiv derived classes accordin to the user requirements.
The Syntax of the pure virtual function is
class class_name { visibility mode:\\should be protected: virtual return_type function_name()=0; } new class_name : inheritance_type old class_name { ............... }
Pure Virtual Function is a Virtual function with no body.
Since pure virtual function has no body, the programmer must add the notation =0 for declaration of the pure virtual function in the base class.
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
In inheritance if the base class contains a virtual function equating to zero, it is known also as do-nothing function & that base class is called as abstract base class as there are no instances or objects can be created by this base class. And this pure virtual can be filled with the codes in successiv derived classes accordin to the user requirements.
The Syntax of the pure virtual function is