-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.cpp
54 lines (46 loc) · 857 Bytes
/
single.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
#include<iostream>
using namespace std;
class Base
{
public:
int A,B;
Base()
{
cout<<"Inside Base constructor\n";
}
~Base()
{
cout<<"Inside Base destructor\n";
}
void fun()
{
cout<<"Inside Base Fun\n";
}
};
class Derived : public Base
{
public:
int X,Y;
Derived()
{
cout<<"Inside derived constructor\n";
}
~Derived()
{
cout<<"Inside derived destructor\n";
}
void gun()
{
cout<<"Inside gun of derived\n";
}
};
//doxygen comment
int main()
{
Derived * ptr = NULL;
ptr = new Derived;
ptr->fun();
ptr->gun();
delete ptr;
return 0;
}