Hey all,
So I have a file called h.list which is a text file containing all of the filenames of the working files the rest of my program will open sequentially and use. Now for some reason the loop always reads the last file in h.list twice though I see no reason why it should.
Code:
if((plist=fopen("h.list","r"))==NULL)
{
printf("Cannot open h.list \n");
exit(0);
}
while(!feof(plist)){
fscanf(plist,"%s", FILENAME);
printf("Read %s from h.list\n", FILENAME);
/* Open the file and read the points into arrays */
getpoints(FILENAME);
/* Perform the Radial Distribution Calculation */
nearest_neightbor(2);
/* Write n(r) and g(r) to a file */
writeOutput(k);
k++;
}
Any help would be greatly appreciated!
Cheers,
Paddon