I have attempted a couple of different times to open a .txt file in a program, however it always goes to the "file was not opened." Is there someone who could let me know where I am going wrong? Thank you for taking the time to help!
Code:#include <stdio.h> #include <stdlib.h> int main() { FILE *inFile; inFile = fopen("caps.txt","r"); if (inFile == NULL) { printf("\nThe file was not successfully opened."); printf("\nPlease check that the file currently exists.\n"); exit(1); } printf("\nThe file has been successfully opened for reading.\n"); return 0; }