What is the difference between virtual functions and pure virtual functions?
Answers were Sorted based on User's Feedback
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 |
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 |
How to delete array of objects in C++? Proof by C++ code for proper deletion
Briefly explain various access specifiers in C++.
explain the term 'resource acquisition is initialization'?
What are the advantages/disadvantages of using inline and const?
Define type casting in C++.
What are Agilent PRECOMPILERS?
What Is Polymorphism in C++ ?
3 Answers IBS, Impetus, ITC Indian Tobacco Company, Motorola,
What is an abstract class?
How to generate random numbers in C++ with a range?
What is a class in C++?
2 Answers Amazon, TCS, UGC Corporation,
What is meant by exit controlled loop?
What are the different scope C++ provide ?