Ok that can work... but you need an extra step in there... fopen doesn't understand text formatting....
Originally Posted by awb8.
In the interests of clarity you may want to make your file processing into a function call and call it from the spot marked but there's nothing wrong with doing it all in one big loop.
for (z=10; z<21; z++) // assuming numbers from 10 to 20 inclusive
infile = fopen(fName "r");
if (infile == NULL)
printf("Can't open %s \n",fName);
// process your data here
} // end of for loop