I have written this code in an attempt to read a .txt file. I am getting the following outcome when trying to run it...
int main()
{
FILE *pToFile = fopen("Marks.txt", "r");
int line = 0;
int num;
char Students[100];
for (int i = 0; i < 100 && ( fscanf(pToFile, "%d" , &num) == 1); ++i)
{
Students[line] = num;
printf("%d", Students[line]);
}
fclose(pToFile);
}
I am unsure how to solve this issue. Many thanks