what is virtual function?

Answer Posted / manav sharma

It allows one to write generalized code that works with the
base class pointer which can dynamically point to the
derieved class objects. Virtual function allows you to
implement runtime polymorphism. It allows the function call
to be binded with function definition as late as runtime.

Also read: concept of VPTR and VTABLE from Thinking in C++

Is This Answer Correct ?    56 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is interface in oop?

662


What are the two different types of polymorphism?

672


What is polymorphism used for?

572


What is oops with example?

564


Can you inherit a private class?

631






Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.

1786


What is abstraction in oop?

631


What is balance factor?

589


just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.

6485


How does polymorphism work?

635


Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?

4240


Can destructor be overloaded?

597


What is advantage of inheritance?

690


assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).

1662


How do you define a class in oop?

628