-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut38.cpp
More file actions
25 lines (22 loc) · 718 Bytes
/
tut38.cpp
File metadata and controls
25 lines (22 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include<iostream>
using namespace std;
class base{
protected:
int a;
private:
int b;
};
/* For a protected member
Public Derivation Private Derivation Protected Derivation
Private members Not Inherited Not Inherited Not Inherited
Protected members Protected Private Protected
Public members Public Private Protected
*/
class derived : base{
};
int main(){
base b;
derived d;
//cout<<d.a; ---> wont run as a is protected in both base derived class
return 0;
}