C++ abstract class is conceptually a class that cannot be instantiated and it should be implemented as a class that has one or more pure virtual (abstract) functions. A pure virtual function is one which must be overridden by any concrete (i.e., non-abstract) derived class.

Before understanding abstract class in C++, it is essential to know the concepts of  virtual functions as it is an integral part of learning the concept of abstract classes in C++.

We cannot create the instance of an abstract class. We can create pointer and reference of base abstract class points to the instance of the child class.

Abstract Class in C++

A class is the abstract if it has at least one pure  virtual function. A pure virtual function in C++ can be stated as the function which is only declared in the base class, and it is defined in the derived classes. In simpler words, it can be stated as the  functions which are only declared, and it’s not implemented in the base class. Those functions are known as virtual functions.

#c++ #c++ abstract class

Abstract Class in C++ Example | C++ Abstract Class Tutorial
4.40 GEEK