struct option { char *name; int has_arg; int *flag; int val; }; static struct option const options[] = { {"whatisup", 1, 0, 0}, {"helloworld", 2, 0, 0}, {"version", 3, 0, 0}, {"help", 4, 0, 0}, {"etc", 5, 0, 0}, {0, 0, 0, 0}, }; void puts(char *x); int main() { for (struct option *opt = options; opt->name; opt++) { puts(opt->name); } }