Skip to content

Commit ef42c31

Browse files
committed
callback method test
1 parent f5e5f9b commit ef42c31

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

cpp/callbacktest.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <iostream>
2+
using namespace std;
3+
void A(int number){
4+
cout << "Hello" << number << "\n";
5+
}
6+
void B(void (*ptr) (int)){
7+
ptr(2002);
8+
}
9+
int main(){
10+
void (*p)(int) = &A;
11+
B(p);
12+
return 0;
13+
}

cpp/callbacktest.exe

55.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)