What are virtual functions?

What are virtual functions?

virtual functionsdefines as :
> C++ virtual function is a member function of a class, whose functionality can be over-ridden in its derived classes. The whole function body can be replaced with a new set of implementation in the derived class.
> A virtual function is a member function which we may redefine for other derived classes, And can ensure that the compiler will call the redefined virtual function for an object of the corresponding derived class, Even if we call that function with a pointer or reference to a base class of the object.
> A virtual function is a member function of a class, which functionality can be over-ridden in its derived classes. It is one that is declared as virtual in the base class using the virtual keyword.
> C++ virtual function properties are:
* A member function of a class.
* Declared with virtual keyword.
* Usually has a different functionality in the derived class.
* A function call is resolved at run-time.

By:
Date:2031-12-08 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related C Subjective Links

C Subjective interview questions and answers for experienced and fresher