#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* bands; // (first arg is the name of the program) int bandscount = argc - 1; // allocate enough bytes bands = malloc(bandscount * sizeof(struct db_entry)); int i = 0; for(i=0; i<bandscount; i++) { bands[i].name = argv[i+1]; bands[i].value = "WOO!"; printf("Band %d: %s => %s\n", i, bands[i].name, bands[i].value); } // release the memory free(bands); return 0; }