The code I have is as follows:
FILE *txt_file = fopen(\"data.txt\", \"r\"); if (txt_file == NULL) { perror(\"Can\'t open file\"); }
Th
I just had a similar issue like this where I knew the path was correct and the file was in the right location. Check the file permissions. It is possible that the program cannot access the file because it is getting permission denied.