I Have written this code for a programming assignment in a C/C++ class and I can not find were it is having problems
*************** ***
*************** *******
complete code attached.
I think the problems with how I pass the list but I am not sure the error when I put the the FILE with the following data
Smith John 90.00
Willis Josh 60.50
Apple Kate 75.33
Ford Mary 85.45
is a Segmentation fault
not very much help I know
any step in the right direction will be a great help.
*************** ***
Code:
struct student { char last_name[20]; char frist_name[20]; float points; char grade; }; ... void sort(struct student list[], int n) ... fp1=fopen(argv[1], "r"); ... while(check!=EOF) { n++; check=fscanf(fp1, "%s %s %d",list[n].last_name, list[n].frist_name, list[n].points); } compute_grade(list,n); sort(list, n); ... }
complete code attached.
I think the problems with how I pass the list but I am not sure the error when I put the the FILE with the following data
Smith John 90.00
Willis Josh 60.50
Apple Kate 75.33
Ford Mary 85.45
is a Segmentation fault
not very much help I know
any step in the right direction will be a great help.
Comment