void teste(void) { printf("Hello World!\n"); } struct teste { void (*func)(); } *p; int main(void) { p = malloc(sizeof(struct teste)); p->func = teste; p->func(); free(p); return 0; }