Question: Need help wring a C function which reads list of courses from a file and stores in array of structures using fscanf and/or fread The
Need help wring a C function which reads list of courses from a file and stores in array of structures using fscanf and/or fread
The course description can be larger than the space available to store in the structure. in those cases need to properly truncate the string and continue read from file.
file format: name|?prerequisite1----?prerequisiteN|type|hours
each course can have 0 - 3 prerequisites and each is proceeded by ?.
structure format:
typedef struct course {
char name[50]
char prerequisite[3][50]
enum crstype type
int hours
}course_t
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
