Write a note about the virtual member function?



Write a note about the virtual member function?..

Answer / Deep Kumar Singh

A virtual member function is a member function that can be overridden by derived classes. When a virtual function call is made through a base class pointer or reference, the correct version (either from the base or derived class) gets called depending on the type of object at runtime. This enables polymorphic behavior in C++.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

When is the copy constructor called?

1 Answers  


reading material is provided 3 books for c++ if u need more do let me know thnx i hve lots of material do let me know if u want it

2 Answers  


Explain one-definition rule (odr).

1 Answers  


What is the use of main function in c++?

1 Answers  


Is java the same as c++?

1 Answers  


What is the difference between std::vector and std::list

1 Answers  


Write a recursive program to calculate factorial in c++.

1 Answers  


Explain rethrowing exceptions with an example?

1 Answers  


What is the difference between while and do while loop? Explain with examples.

1 Answers  


What are mutator methods in c++?

1 Answers  


What is an undefined behavior and sequence points

1 Answers  


Which is the best c++ compiler for beginners?

1 Answers  


Categories