#include "stdio.h" #include <stdlib.h>
//#if 0
void func(char *s)
{
printf(s);
} //#endif
typedef struct {
int age;
char *name;
void (*func)();
}student;
int main(void)
{
student *lxl=malloc(sizeof(student));
lxl->age=11;
lxl->name="lxl";
lxl->func=func;
printf("hello world!\n");
lxl->func(lxl->name);
free(lxl);
return 0;
}
原文:http://www.cnblogs.com/luxiaolai/p/4910930.html