Inheritance access control

The type of inheritance shows whether access to elements of the base class is restricted when inheriting. It is given in front of the name of the base class. Only public or protected data elements can be inherited from the superclass. private data elements are only known within the class. The standard inheritance type is private, so this keyword can be omitted.

class A {
	private:
		// private data and functions,
		// which are only known in this class.
	public:
		// public data and functions,
		// which are also known outside of this class.
	protected:
	    // protected data and functions,
	    // known within the class and the heirs.}
class B : private A {}
class C : public A {}
class D : protected A {} 
Is an element in Apublicprotectedprivate
it will be in Bpublicprotectedwill not be passed
it will be in Cprotectedprotectedwill not be passed
it will be in Dprivateprivatewill not be passed