A class in C++ represents a user-defined data structure. It’s similar to a C++ struct.

Concrete class

The basic idea of ocncrete classes is that they behave “just like built-in types”.

(Stroustrup 2022)

Classes without any abstract methods.

Abstract class

Classes with at least one abstract method.

An example of an abstract class is the following Container:

class Container {
 public:
  virtual double& operator[](int) = 0;
  virtual int size() const = 0;
  virtual ˜Container() {}
};

See Pure virtual function

Inheritance and implementation

Foo implements Container in the following example. Container is the base-class and Foo is the derived-class.

class Container {
 public:
  virtual double& operator[](int) = 0;
  virtual int size() const = 0;
  virtual ˜Container() {}
};

class Foo : public Container {
  // ...
}

Bibliography

Stroustrup, Bjarne. 2022. A Tour of C++. Third. C++ in-Depth Series. Boston: Addison-Wesley.