/* readbinfile.c - Reads a file containing a sequence of binary records * and writes it out to standard output. [The input * file was created by makebinfile.c] */ #include #define SIZE 10 #define NAMESIZE 25 typedef struct { char name[NAMESIZE]; int midterm; int final; int homeworks; } student; int readastudent(FILE *fdin, student * who){ /* Read from an open binary file fdin into who * and return the number of bytes read or EOF if at end * of file */ char * p; /* Cursor in inputting a byte at a time */ char * limit = ((char *)who)+sizeof(student); /*Address just past who */ for (p=(char *)who; p