#include union foo { int i; char *s; }; struct _param { char *name; int type; union foo params; }; static struct _param argumente[] = { { "name1", 1, { .i = 1 } }, { "name2", 2, { .s = "Hallo" } }, { NULL, 0, { .i = 0 } }, }; int main (int argc, char *argv[]) { int i = 0; while (argumente[i].name) { switch (argumente[i].type) { case 1: fprintf (stderr, "%s: Int (%d)\n", argumente[i].name, argumente[i].params.i); break; case 2: fprintf (stderr, "%s: Int (%s)\n", argumente[i].name, argumente[i].params.s); break; default: fprintf (stderr, "huh\n"); break; } i++; } return 0; }