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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / Narendra Pratap Gangwar

A virtual function is a non-static member function of a base class that can be redefined by any derived classes. Pure virtual functions are virtual functions without an implementation in the base class, and they are used to force derived classes to provide an implementation for that particular function. A class with at least one pure virtual function is an abstract class.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ Interview Questions

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

1 Answers  


Briefly explain various access specifiers in C++.

1 Answers   Amdocs,


explain the term 'resource acquisition is initialization'?

1 Answers   Amazon,


What are the advantages/disadvantages of using inline and const?

1 Answers   Amazon,


Define type casting in C++.

1 Answers   Amdocs,


What are Agilent PRECOMPILERS?

1 Answers   Agilent,


What Is Polymorphism in C++ ?

3 Answers   IBS, Impetus, ITC Indian Tobacco Company, Motorola,


What is an abstract class?

6 Answers   Siemens,


How to generate random numbers in C++ with a range?

1 Answers  


What is a class in C++?

2 Answers   Amazon, TCS, UGC Corporation,


What is meant by exit controlled loop?

1 Answers   Adobe,


What are the different scope C++ provide ?

1 Answers   Amdocs,


Categories