#include <stdlib.h> #include <stdio.h> struct db_entry { char* name; char* value; }; int main(int argc, char** argv) { // this is really an array! struct db_entry* entry; // (first arg is the name of the program) int entrycount = argc - 1; // allocate enough bytes entry = malloc(entrycount * sizeof(struct db_entry)); int i = 0; for(i=0; i<entrycount; i++) { entry[i].name = argv[i+1]; entry[i].value = "WOO!"; printf("Person %d: %s => %s\n", i, entry[i].name, entry[i].value); } // release the memory free(entry); return 0; }