what is virtual function?
Answer Posted / laxmikant
A virtual function is a function which is precedded by the
key word derived is declared in the base class.It is
normally used to achieve run time polymerphism.That means
we can override the base class function in the derived
class.We can invoke the virtual function through the base
class pointer depending upon the contents to which the base
class pointer points to.
Generally the implementation of virtual
class was found in inheritance where the base class
function is override in the derived class.
| Is This Answer Correct ? | 23 Yes | 6 No |
Post New Answer View All Answers
class type to basic type conversion
why reinterpret cast is considered dangerous?
What is polymorphism what are the different types of polymorphism?
IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?
What are classes oop?
What is the point of polymorphism?
can inline function declare in private part of class?
Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.
What is the renewal class?
What is advantage of inheritance?
What are the important components of cohesion?
What is oops and why we use oops?
Why is polymorphism needed?
What are main features of oop?
What is the main purpose of inheritance law?