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

Write a single instruction that will store an EVEN random integer between 54 and 212 inclusive in the variable myran. (NOTE only generate EVEN random numbers)

0 Answers  


What is the difference between a reference and a pointer?

0 Answers  


What is the best c++ compiler?

0 Answers  


Explain the purpose of the keyword volatile.

0 Answers  


How can you link a c++ program to c functions?

0 Answers  






How do you print a string on the printer?

0 Answers  


What is the iunknown interface?

0 Answers  


What is the equivalent of Pascal's Real a) unsigned int b) float c) char

0 Answers  


What are the main features of c++?

0 Answers  


Is multimap sorted c++?

0 Answers  


What is a storage class used in c++?

0 Answers  


write a program to add two numbers without using an arithmetic operator.

1 Answers   NIIT,


Categories