I just started to learn C and came across this error when trying to run a simple program to open a .txt file.


Before trying to iterate through your file, test the pointer returned by fopen() :
if(!pToFile) // or if(pToFile == NULL)
exit(1); //exit the program
fopen()can return error, so check for that. And put code and error in the post rather than screenshots."stdio.h"instead of<stdio.h>.test.datin the code when you stateopen a .txt filein your question?