1 . fun1表示函数返回值为空和形参为空的类型名(fun1如同声明变量的int)
#include<stdio.h>
typedef void fun1(void);
void test1(void)
{
printf("fun1\n");
}
int main()
{
fun1 *echo;
echo=test1;
echo();
return 0;
}
2 . fun2表示函数返回值为空和形参为空的类型名(fun2如同声明指针变量的int *)
#include <stdio.h>
typedef void (*fun2)(void);
void test()
{
printf("fun2\n");
}
int main()
{
fun2 echo;
echo=test;
echo();
return 0;
}
3 . fun3表示函数返回值为空指针和形参为空的类型名 ( fun1如同声明变量的int )
#include <stdio.h>
typedef void* fun3(void);
void* test(void)
{
printf("fun3\n");
return NULL;
}
int main()
{
fun3 *echo;
echo=test;
echo();
return 0;
}