How to sort strings from a file by giving each line an ordered index using insertion sort in C -
i'm having trouble sorting file, giving each line index. whole point prompt user type in index program can return program line corresponds index number. here code: #include <stdio.h> #include <stdlib.h> #include <stdbool.h> void printunsortedstringfromfile(int amount, char a[]); void printsortedstringfromfile(int amount, char a[]); //bool binsearchnum(int amount, int a[amount], int target, int *current); int main() { file* spdata = fopen("grades.csv", "r"); int ch, number_of_lines = 0; { ch = fgetc(spdata); if (ch == '\n') number_of_lines++; } while (ch != eof); if (ch != '\n' && number_of_lines != 0) number_of_lines++; fclose(spdata); printf("there %d lines in file grades.csv . \n", number_of_lines); int amount = number_of_lines; char a[amount]; printunsortedstringfromfile(amount, a); printsortedstringfromfile(amoun...