Define abstract base classes with pure virtual functions to create interfaces.
An abstract class is a class that is designed to be specifically used as a base class. It cannot be instantiated, meaning you cannot create objects of an abstract class. A class becomes abstract if it has at least one **pure virtual function**. A pure virtual function is a virtual function that is declared in the base class but has no definition. It is declared by assigning `= 0` to its declaration. The syntax is `virtual void myFunction() = 0;`. The purpose of a pure virtual function is to force all concrete (non-abstract) derived classes to provide their own implementation for that function. This effectively creates a contract: any class that inherits from the abstract base class *must* implement all of its pure virtual functions. This is how C++ programmers create interfaces. An interface is a class that consists only of pure virtual functions and has no member variables. It defines a set of behaviors that other classes can promise to implement. For example, you could have an `IShape` interface with pure virtual functions like `getArea()` and `getPerimeter()`. Any class like `Rectangle` or `Circle` that inherits from `IShape` would be required to provide its own logic for calculating area and perimeter. This enforces a consistent interface across different types of shapes, which is extremely useful for building flexible and maintainable systems.