(*p)是固定写法,代表指针变量p将来肯定是指向函数
左边的 void; 指针变量 p 指向的函数没有返回值
右边的 (); 指针变量 p 指向的函数没有形参
#include <stdio.h>
void test();
int main(int argc, const char * argv[]) {
void(*p)();
// 指针变量 p 指向了 test 函数
p = test;
p();
}
void test()
{
printf("调用了test函数\n");
}