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
| void add(int num1, int num2);
void mins(int num1, int num2) { printf("num1 - num2 = %d\n", (num1 - num2)); }
void opreate(void(*method)(int,int), int num1, int num2) { method(num1, num2);
printf("opreate函数的 method指针是多少:%p\n", method); }
int mainT8() {
opreate(add, 10, 10); opreate(mins, 100, 10);
printf("main函数的 add指针是多少:%p\n", add); printf("main函数的 mins指针是多少:%p\n", mins);
printf("%p, %p\n", add, &add);
return 0; }
void add(int num1, int num2) { printf("num1 + num2 = %d\n", (num1 + num2)); }
|