Function pointers: f() { whatever...; } g(funcp) int (*funcp)(); { ... (*funcp)(); ... } main() { int f(); g(f); } Also: ---- typedef int (*PFI)(); then: PFI funcp; /* declare funcp as a function that returns int */ ------------------- Example: #include typedef struct User { int b; char name[100]; char line[100]; int (*processor)(); } user_t; user_t user; int te1() { fprintf(stderr,"HI\n"); return 1; } int te2() { fprintf(stderr,"2\n"); return 2; } int do_echo(char *); int get_name(char *); int do_echo(str) char *str; { fprintf(stderr,"%s typed: %s\n",user.name,str); user.processor=(get_name); return 1; } int get_name(str) char *str; { strcpy(user.name,str); fprintf(stderr,"[%s]\n",str); user.processor=(do_echo); return 2; } main() { int i; user.processor=(get_name); while(1) { gets(user.line); i=(user.processor)(user.line); fprintf(stderr,"return from processor was: %d\n",i); } }