Inheritance in C++

A class in C++ may be inherited or used in another class in C++. For example

class A {public: A(); getAB();  protected: int ab;   };

class C : public A { public: B(); protected: int b; };