Private inheritance

The following code shows how we derive a class from other class.


class Base
{
   ...
}


class Derived: public Base
{
   ....
}


The Derived class is derived from Base with public level of inheritance. If you omit the public word while declaration such as 
class Derived : Base
the level of inheritance will be private.


The private inheritance is only supported in unmanaged C++. Its not supported in managed C++. if you declare the compiler will give error.

No comments:

Post a Comment

Golang: Http POST Request with JSON Body example

Go standard library comes with "net/http" package which has excellent support for HTTP Client and Server.   In order to post JSON ...