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 is rvalue?

0 Answers  


You run a shell on unix system. How would you tell which shell are you running?

0 Answers  


How can you say that a template is better than a base class?

0 Answers  


Where is atoi defined?

0 Answers  


What is the best c++ book?

0 Answers  






Why preincrement operator is faster than postincrement?

5 Answers  


Write a program to get the value of sin (x) using a library function , when x is given in degrees.

1 Answers  


what is data Abstraction? and give example

147 Answers   Aaditya Info Solutions, American Express, CMS, College School Exams Tests, Data Entry Operator, First Advantage, Google, HCL, IBM, Infosys, Microsoft, Mind Links, NIIT, Oracle, Pact, QBit Systems, TCS, WAYA, Wipro,


What is the difference between reference type and pointers.

4 Answers   HCL,


What is the difference between multiple and multilevel inheritance in c++?

0 Answers  


What is c++ map?

0 Answers  


What is a modifier in c++?

0 Answers  


Categories