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

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

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

  p = NULL;

  i=1;

  //for(i=1;i<100;i++){
  while(i<100){  
  person *tmp = realloc(p, (i)*sizeof(person));
    
    if (tmp == NULL){
      fprintf(stderr, "failed to allocate memory\n");
      break;
    }else{
      p = tmp;
      
    }
    printf("%d\t", i);
    strcpy(p[i].first_name, "John");
    strcpy(p[i].family_name, "Croft");
    
    printf("%s %s\n", p[i].first_name, p[i].family_name);
    
  }
  

  free(p);
  p = NULL;
  
  

  /* p = realloc(p, (2)*sizeof(person)); */
  
  /* strcpy(p[1].first_name, "Bengt"); */
  /* strcpy(p[1].family_name, "Brylde"); */
  
  /* printf("%s %s\n", p[1].first_name, p[1].family_name); */
  
  /* free(p); */

  return 0;
}
