Read and write struct in C
- by Sergey
I have a struct:
typedef struct student
{
char fname[30];
char sname[30];
char tname[30];
Faculty fac;
int course;
char group[10];
int room;
int bad;
} Student;
I read it from the file:
Database * dbOpen(char *fname)
{
FILE *fp = fopen(fname, "rb");
List *lst,…