void f(int a, int b) { cout << a + b << endl; } int main() { void(*f1)(int a, int b); // 定义函数指针,它用来指向一个函数。而指针函数指的是返回值是指针的函数 f1 = f; // 也可以: f1=&f,都一样,都表示地址 (*f1)(2, 3); // 通过*来调用函数 system("pause"); return 0; }
原文:https://www.cnblogs.com/pjishu/p/10342814.html