Contents Up << >>

How do you express inheritance in C++?

By the ": public" syntax:

  	class Car : public Vehicle {
	        //^^^^^^^^---- ": public" is pronounced "is-a-kind-of-a'
	  //...
	};
We state the above relationship in several ways: