Horje
c++ public inheritance not getting protected Code Example
c++ public inheritance not getting protected
class A 
{
public:
    int x;
protected:
    int y;
private:
    int z;
};

class B : public A
{
    // x is public
    // y is protected
    // z is not accessible from B
};

class C : protected A
{
    // x is protected
    // y is protected
    // z is not accessible from C
};

class D : private A    // 'private' is default for classes
{
    // x is private
    // y is private
    // z is not accessible from D
};




Cpp

Related
2d array using vector Code Example 2d array using vector Code Example
add two constant char pointers c++ Code Example add two constant char pointers c++ Code Example
delete heap array c Code Example delete heap array c Code Example
Corong_ExerciseNo3(1) Code Example Corong_ExerciseNo3(1) Code Example
create dynamic variable c++ Code Example create dynamic variable c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9