What is virtual Function.

Answer Posted / poonam

Virtual function is a function that uses keyword "virtual"
with the datatype of the function. When the base class as
well as the derived class contains a function both having
the same name, just to resolve ambiguity and copy of the
same data again and again we use the keyword "virtual"
preeceeding it. It is used to achieve poymorphism.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is static modifier?

836


How can you overcome the diamond problem in inheritance?

957


Which language is not a true object oriented programming language?

865


What is difference between oop and pop?

866


Why do we need oop?

871


Can abstract class have normal methods?

783


What are two types of polymorphism?

801


Why is it so that we can have virtual constructors but we cannot have virtual destructors?

4326


what are the different types of qualifier in java?

2012


What is the purpose of enum?

761


can we make game by using c

3713


How to call a non virtual function in the derived class by using base class pointer

5894


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.

2813


What are the three parts of a simple empty class?

1758


#include #include #include #include void insert(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); insert(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void insert(char *items, int count) { register int a, b; char t; for(a=1; a < count; ++a) { t = items[a]; for(b=a-1; (b >= 0) && (t < items[b]); b--) items[b+1] = items[b]; items[b+1] = t; } } design an algorithm for Insertion Sort

2373