[prev] 53 [next]

Exercise 6: Files of Structs

Consider a new Student struct ...

typedef struct _student {
  int id; char given[50]; char family[50]; int prog; float wam;
} Student;

Write a program to ...

  • read in data about one student
  • append the data to a file of students
Write a program to ...
  • scan the file of students and print data for each one
Write two versions of each program ...
  • one using the write()/read() approach
  • one using the printf()/scanf() approach