I'm using fopen to open a file in my program and I can't get the file to open for reading. Here's what I'm doing
filename_in is defined to "test_data.txt"
if((*fp_in = fopen(filename_in, "r")) == NULL)
// display error message
printf("\nERROR: Input file not opened\n");
This little snippet should open the file and test whether or not it was opened. since *fp_in is returned null, I get the "input file not opened" message. Where does the test_data.txt file need to be in order for this to work? i.e. same directory as source file or what? Thanks!