typedef struct _student {
int id; char name[99]; float wam;
} Student;
int infd, outfd;
FILE *inf, *outf;
Student stu;
write(outfd, &stu, sizeof(struct _student));
fprintf(outf, "%d:%s:%f\n",
stu.id, stu.name, stu.wam);
read(infd, &stu, sizeof(Student));
fscanf(inf, "%d:%[^:]:%f\n",
&(stu.id), &(stu.name), &(stu.wam));
|