Question: Change this program: void schedule _ save ( ) { FILE * fileptr; fileptr = fopen ( course _ collection.txt , r

Change this program: void schedule_save(){
FILE *fileptr;
fileptr = fopen("course_collection.txt","r");
if (fileptr == NULL){
printf("You need to create the file to save first.
");
}
else {
char line[512];
printf("Subject, number, credit & teacher
");
while (fgets(line, sizeof(line), fileptr)){
char *index = strtok(line,"");
char *subject = index;
index = strtok(NULL,"");
int number = atoi(index);
index = strtok(NULL,"");
int creditHours = atoi(index);
index = strtok(NULL,"");
char *teacher = index;
printf("%s\t%d\t%d\t%s
", subject, number, creditHours, teacher); //print file
}
}
}
Make it so it loads the file and is named schedule_load

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!