#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct person_ {
    // Hmmmm, not good enough to have fixed name sizes
    char first_name[20];
    char family_name[20];
} person ;

int main() {
    person *p;
    person *tmp;
    int i;

    p = NULL;
    for (i=0; i<100; i++) {
        tmp = realloc(p, (i+1)*sizeof(person));
        if (tmp==NULL) {
            fprintf(stderr, "Failed to allocate memory!\n");
            return 1; // indicate errror to user
        }
        p=tmp;

        // sprintf is ok in this case - we know what we have
        sprintf(p[i].first_name, "%s the%dth", "Henry", i);
        strcpy(p[i].family_name, "Rollins");
    }

    for (i=0; i<100; i++) {
        printf("%s %s\n", p[i].first_name, p[i].family_name);
    }

    free(p);
    return 0;
}
