/* makebinfile.c - Reads a file containing a sequence of text records * and writes it out to a new binary files. * The names of the files are passed in as command * line parameters. */ #include #define SIZE 10 #define NAMESIZE 25 typedef struct { char name[NAMESIZE]; int midterm; int final; int homeworks; } student; int writeastudent(FILE *fdout, student * who){ /* Write to an open binary file fdout the content of who. * Return the number of bytes that were written out. */ char * p; /* Cursor in outputting a byte at a time */ char * limit = ((char *)who)+sizeof(student); /*Address just past who */ for (p=(char *)who;p