what is virtual function?

Answer Posted / aarti ashar

A virtual function is a function member of a class,
declared using the "virtual" keyword. A pointer to a
derived class object may be assigned to a base class
pointer, and a virtual function called through the pointer.
If the function is virtual and occurs both in the base
class and in derived classes, then the right function will
be picked up based on what the base class pointer "really"
points at.

Is This Answer Correct ?    25 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can enum be null?

583


What is polymorphism in oops with example?

525


What is the types of inheritance?

596


String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?

1938


write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).

1636






What is the main purpose of inheritance law?

667


What is encapsulation in oops?

534


Can we create object of abstract class?

575


What is the diamond problem in inheritance?

574


What do you mean by overloading?

576


What is the difference between procedural programming and oops?

548


What is oops?what is its use in software engineering?

553


Why interface is used?

549


What is object and class in oops?

582


What is difference between multiple inheritance and multilevel inheritance?

601