Your question is not very clear but I'm guessing you mean something like this:
int i = 42;
char fname[PATH_MAX];
snprintf(fname, PATH_MAX, "file_%d.txt", i);
FILE * f = fopen(fname, "w");
if (f != NULL)
{
// write stuff to f...
fclose(f);
}
This opens a file named "file_42.txt" for writing.