Code:
....
char filename[10]; //the name, like FILE in your example, or anything else you would like
char varStr[7]; // the number followed by .ext
char newFilename[17]; //the filename you want
...
strcpy(varStr, "00.ext"); //varStr is "00.ext"
newFilename = strcat(filename, varStr); //this appends the varStr to the filename
...
//This creates FILE00.ext, FILE01.ext etc etc
FILE * fd[5];
for (int i=0; i<5; ++i) {
newFilename = strcat(filename, varStr);
fd[i] = fopen(newFilename, "w");
varStr[1]++;
}
Notice that varStr[1] = '0' at the beggining. If you increase it it will be '1' (not 1, but the char '1'). And so on. At the tenth file of course you have to set varStr[1] = '0' and varStr[0] = '1'. Last note, every string is null-terminated. If you make that sure then it should work for a size less than the maximum size of the array