Answers

Question and Answer:

  Home  C++ Inheritance

⟩ How to implement inheritance in C++?

class Square: public Shape

{

...

};

In the above example all public members of Shape can be reused by the class Square. If public key word is left, private inheritance takes place by default. If protected is specified the inheritance is applied for any descendant or friend class.

 179 views

More Questions for you: