what is virtual function?
Answer Posted / nk
A virtual function is basically a like normal function but
we can override the function in the derived classes.
Now when we want to access like (fn)
Base * bptr = new Derived();
bptr->fn(); then function of the derived class will be
called only if the function is marked as virtual in the
base class.
i.e the virtual keywork tells to use the function of the
class to which it is pointing to and not to the Base class.
This is called runtime polymorphism.
| Is This Answer Correct ? | 24 Yes | 7 No |
Post New Answer View All Answers
What is difference between oop and pop?
#include
What is encapsulation oop?
What is the difference between a mixin and inheritance?
What is and I oop mean?
What is a class in oop?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
Why do we use polymorphism in oops?
officer say me - i am offered to a smoking , then what can you say
What is inheritance in simple words?
Which type does string inherit from?
What is polymorphism oop?
What is polymorphism programming?
i am getting an of the type can not convert int to int *. to overcome this problem what we should do?
What is oops in simple words?