I am trying to get a list of numbers from a file and store each number in an array.
I think I have the structure right but I'm getting a memory referance error and the warning that comes up is:
'l' : unrecognized character espace sequence
what does that mean?
here is my read_file function
Code:// Read data file double read_file(int num_temps, double temps[]) { int i=0; double temp; FILE *filedata; filedata = fopen(DATA,"r"); if(filedata == NULL) { printf("Error opening file.\n"); } else { while (fscanf(filedata,"%lf",&temp) == 2) { temps[num_temps] = temp; num_temps++; } } fclose(filedata); return num_temps; }



LinkBack URL
About LinkBacks


