what is virtual function in c++

Answer Posted / sree

virtual function comes into picture while inheriting the
base class functions to the derived class functions.
ifthe virtual isnot used then the pointer of derived class
points to the baseclass function

Is This Answer Correct ?    28 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is solid in oops?

814


What is the important feature of inheritance?

868


Which type does string inherit from?

853


There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.

1717


What is polymorphism what is it for and how is it used?

785


Prepare me a program for the animation of train

2231


What is the main purpose of inheritance law?

955


What is polymorphism and its types?

815


What are the three main types of variables?

837


What is methods in oop?

749


Can a destructor be called directly?

815


Can we define a class within the interface?

800


What is encapsulation with example?

803


What are constructors in oop?

809


write string class as your own class in java without using any built-in function

2223