The structure use only pointer to character.
Code:
typedef struct record {
char *fname;
char *lname;
int code;
} information;
First, the function strdup is unknown for me, but i assume that you want to copy the string (strcpy/strncpy).
But this will not work, because there are only pointers in the structure. There are no space for characters.
Second: if the input file isn't open, you return without a value, but the main function should return a integer.
Third: you don't check the output file.
Code:
…
ufile= fopen("update.txt","w");
fprintf(ufile,"First Name Last Name ID Status Time Arrived\n");
for (i = 0; i < x; i++) {
fprintf(ufile,"%-15s%-14s%2d%12s ",(array[i].fname), (array[i].lname), (array[i].code), status);
fprintf(ufile,"%16s",(buf));
}//end of for loop
fclose(ufile);
…
The indentation is also a little bit broken.
Update your code and post it here in code-tags.