Sections


Main-Menu

header image

Virtual Function


Virtual Function

Virtual function is a function, whose functionality can be over-ridden in its derived classes. Virtual function is a member function of a class. In derived class the whole function body can be replaced with a new set of implementations.

Properties:

•    Virtual function is a member function of a class
•    Virtual function is declared having virtual keyword preceding the function name.
•    The functionality of virtual function in the derived class is different.
•    function calls are resolved at run-time.

The basic difference between a function and a virtual function is that normal functions are resolved at compile time, while the virtual functions are resolved at run-time.


Related Articles :



Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Shaadi.com Matrimony - Register for FREE