What are virtual functions and what is its use?



What are virtual functions and what is its use?..

Answer / hrpynux@gmail.com

A virtual function is a member function that you expect to be redefined in derived classes. When you refer to a derived class object using a pointer or a reference to the base class, you can call a virtual function for that object and execute the derived class's version of the function.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

what are the decision making statements in C++? Explain if statement with an example?

0 Answers  


why is iostream::eof inside a loop condition considered wrong?

0 Answers  


Explain the benefits of proper inheritance.

0 Answers  


Explain container class.

0 Answers  


What does '\r' and '\b' mean? Please explain with example.

7 Answers  






Define a nested class.

0 Answers  


What does catch(…) mean?

0 Answers  


What is c++ map?

0 Answers  


Why do you use the namespace feature?

0 Answers  


Perform addition, multiplication, subtraction of 2-D array using Operator Overloading.

0 Answers   Nucleus, TCS,


Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.

0 Answers  


When is a template better solution than a base class??

2 Answers   emc2,


Categories