How do we implement inheritance in C++?

How do we implement inheritance in C++?

- The inheritance feature in C++ is implemented in the following manner :
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.
What is inline function? - C++
What is inline function? - An inline function is a combination of macro & function. At the time of declaration or definition, function name is preceded by word inline....
Difference between inline functions and macros - C++
Difference between inline functions and macros - A macro is a fragment of code which has been given a name. Whenever the name is used, it is replaced by the contents of the macro.....
What are static member functions?
What are static member functions? - A static function can have an access to only other static members (functions or variables) declared in the same class......
Post your comment