Page 1 of 1

} if (fp == NULL) { printf("file%s Open failed\n", FILE_NAME); exit(EXIT_FAILURE); } //Read the total number of student

Posted: Mon Jun 06, 2022 11:08 am
by answerhappygod
If Fp Null Printf File S Open Failed N File Name Exit Exit Failure Read The Total Number Of Student 1
If Fp Null Printf File S Open Failed N File Name Exit Exit Failure Read The Total Number Of Student 1 (66.27 KiB) Viewed 34 times
If Fp Null Printf File S Open Failed N File Name Exit Exit Failure Read The Total Number Of Student 2
If Fp Null Printf File S Open Failed N File Name Exit Exit Failure Read The Total Number Of Student 2 (66.27 KiB) Viewed 34 times
If Fp Null Printf File S Open Failed N File Name Exit Exit Failure Read The Total Number Of Student 3
If Fp Null Printf File S Open Failed N File Name Exit Exit Failure Read The Total Number Of Student 3 (66.27 KiB) Viewed 34 times
If Fp Null Printf File S Open Failed N File Name Exit Exit Failure Read The Total Number Of Student 4
If Fp Null Printf File S Open Failed N File Name Exit Exit Failure Read The Total Number Of Student 4 (66.27 KiB) Viewed 34 times
If Fp Null Printf File S Open Failed N File Name Exit Exit Failure Read The Total Number Of Student 5
If Fp Null Printf File S Open Failed N File Name Exit Exit Failure Read The Total Number Of Student 5 (66.27 KiB) Viewed 34 times
If Fp Null Printf File S Open Failed N File Name Exit Exit Failure Read The Total Number Of Student 6
If Fp Null Printf File S Open Failed N File Name Exit Exit Failure Read The Total Number Of Student 6 (66.27 KiB) Viewed 34 times
If Fp Null Printf File S Open Failed N File Name Exit Exit Failure Read The Total Number Of Student 7
If Fp Null Printf File S Open Failed N File Name Exit Exit Failure Read The Total Number Of Student 7 (66.27 KiB) Viewed 34 times
} if (fp == NULL) { printf("file%s Open failed\n", FILE_NAME); exit(EXIT_FAILURE); } //Read the total number of student nodes in the first row fscanf(fp,"%d", &L->count); //The data is read circularly, and the number of cycles is count for (int i = 1; i <= L->count; i++) { //Create a new node studentNode* s= (studentNode*)malloc(sizeof(studentNode)); //Read data fscanf(fp,"%s", s->stu.name); fscanf(fp,"%d", &s->stu.number); fscanf(fp,"%d", &s->stu.chinese); fscanf(fp,"%d", &s->stu.math); fscanf(fp,"%d", &s->stu.english); fscanf(fp,"%d", &s->stu.sum); fscanf(fp,"%d", &s->stu.average); //Insert the new node into the tail of the linked list (tail insertion method) s->next = NULL; L->tail->next = S; L->tail = s; } //Close file stream fclose(fp);
} if (fp == NULL) { printf("file%s Open failed\n", FILE_NAME); exit(EXIT_FAILURE); } //Read the total number of student nodes in the first row fscanf(fp,"%d", &L->count); //The data is read circularly, and the number of cycles is count for (int i = 1; i <= L->count; i++) { //Create a new node studentNode* s= (studentNode*)malloc(sizeof(studentNode)); //Read data fscanf(fp,"%s", s->stu.name); fscanf(fp,"%d", &s->stu.number); fscanf(fp,"%d", &s->stu.chinese); fscanf(fp,"%d", &s->stu.math); fscanf(fp,"%d", &s->stu.english); fscanf(fp,"%d", &s->stu.sum); fscanf(fp,"%d", &s->stu.average); //Insert the new node into the tail of the linked list (tail insertion method) s->next = NULL; L->tail->next = S; L->tail = s; } //Close file stream fclose(fp);
} if (fp == NULL) { printf("file%s Open failed\n", FILE_NAME); exit(EXIT_FAILURE); } //Read the total number of student nodes in the first row fscanf(fp,"%d", &L->count); //The data is read circularly, and the number of cycles is count for (int i = 1; i <= L->count; i++) { //Create a new node studentNode* s= (studentNode*)malloc(sizeof(studentNode)); //Read data fscanf(fp,"%s", s->stu.name); fscanf(fp,"%d", &s->stu.number); fscanf(fp,"%d", &s->stu.chinese); fscanf(fp,"%d", &s->stu.math); fscanf(fp,"%d", &s->stu.english); fscanf(fp,"%d", &s->stu.sum); fscanf(fp,"%d", &s->stu.average); //Insert the new node into the tail of the linked list (tail insertion method) s->next = NULL; L->tail->next = S; L->tail = s; } //Close file stream fclose(fp);
} if (fp == NULL) { printf("file%s Open failed\n", FILE_NAME); exit(EXIT_FAILURE); } //Read the total number of student nodes in the first row fscanf(fp,"%d", &L->count); //The data is read circularly, and the number of cycles is count for (int i = 1; i <= L->count; i++) { //Create a new node studentNode* s= (studentNode*)malloc(sizeof(studentNode)); //Read data fscanf(fp,"%s", s->stu.name); fscanf(fp,"%d", &s->stu.number); fscanf(fp,"%d", &s->stu.chinese); fscanf(fp,"%d", &s->stu.math); fscanf(fp,"%d", &s->stu.english); fscanf(fp,"%d", &s->stu.sum); fscanf(fp,"%d", &s->stu.average); //Insert the new node into the tail of the linked list (tail insertion method) s->next = NULL; L->tail->next = S; L->tail = s; } //Close file stream fclose(fp);
} if (fp == NULL) { printf("file%s Open failed\n", FILE_NAME); exit(EXIT_FAILURE); } //Read the total number of student nodes in the first row fscanf(fp,"%d", &L->count); //The data is read circularly, and the number of cycles is count for (int i = 1; i <= L->count; i++) { //Create a new node studentNode* s= (studentNode*)malloc(sizeof(studentNode)); //Read data fscanf(fp,"%s", s->stu.name); fscanf(fp,"%d", &s->stu.number); fscanf(fp,"%d", &s->stu.chinese); fscanf(fp,"%d", &s->stu.math); fscanf(fp,"%d", &s->stu.english); fscanf(fp,"%d", &s->stu.sum); fscanf(fp,"%d", &s->stu.average); //Insert the new node into the tail of the linked list (tail insertion method) s->next = NULL; L->tail->next = S; L->tail = s; } //Close file stream fclose(fp);
} if (fp == NULL) { printf("file%s Open failed\n", FILE_NAME); exit(EXIT_FAILURE); } //Read the total number of student nodes in the first row fscanf(fp,"%d", &L->count); //The data is read circularly, and the number of cycles is count for (int i = 1; i <= L->count; i++) { //Create a new node studentNode* s= (studentNode*)malloc(sizeof(studentNode)); //Read data fscanf(fp,"%s", s->stu.name); fscanf(fp,"%d", &s->stu.number); fscanf(fp,"%d", &s->stu.chinese); fscanf(fp,"%d", &s->stu.math); fscanf(fp,"%d", &s->stu.english); fscanf(fp,"%d", &s->stu.sum); fscanf(fp,"%d", &s->stu.average); //Insert the new node into the tail of the linked list (tail insertion method) s->next = NULL; L->tail->next = S; L->tail = s; } //Close file stream fclose(fp);
} if (fp == NULL) { printf("file%s Open failed\n", FILE_NAME); exit(EXIT_FAILURE); } //Read the total number of student nodes in the first row fscanf(fp,"%d", &L->count); //The data is read circularly, and the number of cycles is count for (int i = 1; i <= L->count; i++) { //Create a new node studentNode* s= (studentNode*)malloc(sizeof(studentNode)); //Read data fscanf(fp,"%s", s->stu.name); fscanf(fp,"%d", &s->stu.number); fscanf(fp,"%d", &s->stu.chinese); fscanf(fp,"%d", &s->stu.math); fscanf(fp,"%d", &s->stu.english); fscanf(fp,"%d", &s->stu.sum); fscanf(fp,"%d", &s->stu.average); //Insert the new node into the tail of the linked list (tail insertion method) s->next = NULL; L->tail->next = S; L->tail = s; } //Close file stream fclose(fp);