struct command_or_something { char word[15]; (int) (char **args, int argc); }; struct command_or_something COMMANDS[] = { { "ping", \command_handler }, { "quit", \command_handler }, { "echo", \command_handler }, {NULL, NULL} }; int find_coomand (char word) { int i; while (COMMANDS[i]->word !- NULL) { if (strcmp(COMMANDS[i]->word, word) == 0) { /* Found the command */ } } /* not a known command */ } /* there will be some syntax errors but I'm sure you'll get the idea... */