What do you mean by pure virtual functions in C++? Give an example?

Answer Posted / hrpynux@gmail.com

A pure virtual function is a virtual function in C++ for which we need not to write any function definition and only we have to declare it. It is declared by assigning 0 in the declaration. An abstract class is a class in C++ which have at least one pure virtual function.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use the using declaration?

774


Define the process of handling in case of destructor failure?

670


Is it possible to provide special behavior for one instance of a template but not for other instances?

735


total amount of milk produced each morning and then calculates and outputs the number of cartons needed for this milk , the cost of producing the milk and the profit from producing this milk.

2163


How to get the current position of the file pointer?

645






What is difference between n and endl in c++?

664


What is java and c++?

744


What does it mean to declare a member function as static?

690


What is c++ used for in games?

699


What can I safely assume about the initial values of variables which are not explicitly initialized?

714


Is swift faster than c++?

648


What is the benefit of encapsulation?

692


How is objective c different from c++?

877


Keyword mean in declaration?

678


Why do we use templates?

698