-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpp.cpp
55 lines (42 loc) · 991 Bytes
/
cpp.cpp
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include<iostream>
using namespace std;
class Base
{
public: //Access specifier
int A, B;
void fun() //function definition 1000
{
cout<<"Base Fun\n";
}
void gun(int i) //function definition 2000
{
cout<<"Base gun with 1 integer\n";
}
void gun(int i , int j) // overloaded function definition 3000
{
cout<<"Base gun with 2 integer\n";
}
};
class Derived : public Base
{
public:
int X, Y;
void sun() //function definition 4000
{
cout<<"Derived function\n";
}
void fun() //function redifinition 5000
{
cout<<"Derived fun\n";
}
};
int main()
{
Derived dobj;
dobj.sun();
dobj.fun();
dobj.A;
dobj.B;
dobj.X;
return 0;
}