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
#include <iostream>
#include <functional>
using namespace std;
class Test
{
public:
void display()
{
cout << "dispaly\n";
}
void display(int b)
{
cout << b << " display\n";
}
};
void fn1(Test* ptr,void(Test::*fp3)())
{
(ptr->*fp3)();
}
void fn2(Test* ptr,void(Test::*fp3)(int),int a)
{
(ptr->*fp3)(a);
}
int add5(int a)
{
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run