OK this is more of a logistics question than anything. I'm running XCode on my Macbook right now and can't figure out how to read in a file in my program.
Basically there is a pixel_load.dat file that needs to be read in the program.
Code:
#define FILENAME "pixel_load.dat"
//Start of main function
int main(void)
{
// declarations
FILE *pixel_load = NULL;
int i, num_measurements, N;
double displacement_pixels[MAX_VALUES], load[MAX_VALUES];
pixel_load = fopen(FILENAME, "r");
if(pixel_load == NULL)
{
printf("Could not open data file\n");
return -1;
}
My professor said something about you can put a file in a certain spot so that you don't have to put a path to the file in the #define part. Where might that be on a Mac?
Also I tried just putting it in my program's folder right beside the main.c file and putting that path (my path was something like "\\Users\\JakeeStoltz\\Photograph\\pixel_load.dat" ) in the #define part but that didn't seem to work..