I wrote a program in linux which parsed the headers of some data files I have. Now, I've tried to port it to windows, and everything seems to work except I can't seem to actually read the data! The data is in ASCII format, very simple text files. Why is this failing? This is my code:
it goes on for a while like that, but why does it suddenly not work?
int parseFile (char fileName, FILE *out)
int loc=1; //loc is the location of the curser in the string
inp = fopen(fileName, "r");
printf("Could not open %s for reading.\n", fileName);
//get 'arg'th line of data and parse it into data.csv
fgets(dat, sizeof(dat), inp);
fprintf(out, "%s,", str); //print filename
loc=loc+getinp(str,'\'',dat,loc); //search to date
loc=loc+getinp(str,'\'',dat,loc); //print date
fprintf(out, "%s,", str);
If I instead just use fgets and then print the resulting string, I get ASCII garbage. . .
Thanks a bunch,