I'm having trouble figuring out exactly why my program is telling me it can't find files, but i've narrowed it down.
Here's a snippet of the code:
Code:
char *filename;
char num[10];
FILE *imageFileP;
sprintf(num, "%d", i); // i is an integer that represents file name before the dot
strcpy(filename, num);
strcat(filename, ".");
strcat(filename, app->FileExt); // FileExt is a char size [10]
printf("filename is: '%s'\n", filename);
imageFileP = fopen(filename,"r");
printf("filename is: '%s'\n", filename);
on the first print, filename looks exactly right, but on the second print the filename is empty. I believe something is wrong with filename -- even if it looks right -- because I am using char buffers of fixed size to build it. Can someone show me how to adjust my code to make this work?