and also using wierd numbers like char modelname[18][30] should be replaced with
something like
Code:
#define NFILES 18 /*number of files of type modelname */
#define NAMELEN 30 /* maximum length of the filename */
....
....
in function
...
char modelname[NFILES][NAMLEN]
...
...
for (i= 0; i < NFILES; i++)
makes it easier to see whats happening as well as easier to change it if need be.
Code:
sprintf(modelfile[i], "Lightcurves\\%s%s.mag", modelname, inc);
may have to be
Code:
sprintf(modelfile[i], "Lightcurves\\\\%s%s.mag", modelname, inc);
but really if your not using inc for anything else, you should just do what vart suggested
and combine it to one sprintf, and get rid of inc all together