#include typedef enum { COURSE, RESEARCH, STAFF } person_t; typedef struct { char program[10]; short units; } coursework; typedef struct { char* supervisor; short confirmed; char* thesistitle; } rhd; typedef struct { time_t contract_exiry; } staff; typedef union { coursework cw; rhd res; staff st; } person_info; typedef struct { int id; person_t type; person_info info; } person; person* read_person(); void print_person(person* p); double library_fine(person* p); void print_details(person_info pi); int main(int argc, char** argv) { person* p; person* arr[20000]; int i, id; /* load a large number of people */ for (i=0;i<20000;++i) { arr[i]=read_person(); } scanf("%d", &id); /* now search for that id */ for (i=0;i<20000;++i) { p=arr[i]; if (p->id==id) { print_details(p->info); } } }