What is the difference between virtual functions and pure virtual functions?

Answer Posted / hrpynux@gmail.com

A virtual function is a member function of base class which can be redefined by derived class. A pure virtual function is a member function of base class whose only declaration is provided in base class and should be defined in derived class otherwise derived class also becomes abstract.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a constructor return a value?

577


How to delete array of objects in C++? Proof by C++ code for proper deletion

335


Is python written in c or c++?

624


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

2764


write a program that will accept a number and print.its equivalent in words the maximum input number is 9999

2505






Are polymorphisms mutations?

705


Where are setjmp and longjmp used in c++?

626


How stl is different from the c++ standard library?

648


What is constructor c++?

671


If P is the population on the first day of the year, B is the birth rate, and D is the death rate, the estimated population at the end of the year is given by the formula: The population growth rate is given by the formula: B – D Write a program that prompts the user to enter the starting population, birth and death rates, and n, the number of years. The program should then calculate and print the estimated population after n years. Your program must have at least the following functions: 1. growthRate: This function takes its parameters the birth and death rates, and it returns the population growth rate. 2. estimatedPopulation: This function takes its parameters the current population, population growth rate, and n, the number of years. It returns the estimated population after n years Your program should not accept a negative birth rate, negative death rate, or a population less than 2. please answer my question ....

1781


Which format specifier is used for printing a pointer value?

583


Describe the role of the c++ in the tradeoff of safety vs. Usability?

715


What is difference between c++ and c ++ 14?

580


What is const pointer and const reference?

597


Is c++ used anymore?

598