1
0

pa06.h 795 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Do not modify this file
  3. *
  4. * If you modify this file. Your program will fail in grading.
  5. *
  6. */
  7. #ifndef _PA06_H_
  8. #define _PA06_H_
  9. typedef struct
  10. {
  11. int ID;
  12. char * name;
  13. /* If you change this to
  14. char name[80];
  15. you will receive zero */
  16. } Student;
  17. int countStudent(char * filename, int * numstu);
  18. Student * allocateStudent (int numberStudent);
  19. int readStudent(char * filename, Student * studentArray,
  20. int numberStudent);
  21. int writeStudent(char * filename, Student * studentArray,
  22. int numberStudent);
  23. void sortStudentbyID(Student * studentArray, int numberStudent);
  24. void sortStudentbyName(Student * studentArray, int numberStudent);
  25. void swapStudent(Student * student1, Student * student2);
  26. void freeStudent(Student * studentArray, int numberStudent);
  27. #endif