69,336
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <stdio.h>
void fun()
{
printf("hello,world\n");
}
struct test
{
void (*Fun)();
};
int main()
{
struct test t;
t.Fun = fun;
t.Fun(); //直接调用
return 0;
}
#include <iostream>
using namespace std;
typedef struct a {
void test() {}
} A;
int main(int argc, char* argv[])
{
A my_a;
my_a.test();
return 0;
}
typedef int function(int a, int b);
typedef struct
{
function hi;
}TEMP_STRUCT;
....
hi(a,b);