#include <stdlib.h> #include <stdio.h> #include <string.h> struct db_entry { char* name; char* value; }; int main(int argc, char** argv) { // allocate one band on the stack struct db_entry bands; // dynamically set the name and value printf("What's the band's name? "); bands.name = malloc(100); // how much space? scanf("%99s", bands.name); printf("What's the band's value? "); bands.value = malloc(100); scanf("%99s", bands.value); // print the contents and the location (pointer) printf("Band: %s => %s\n", bands.name, bands.value); // release the memory free(bands.name); free(bands.value); return 0; }