ya i know to code a loop..
i tried this code but its not working.. pls help..
Code:
//file name numbering program
#include<stdio.h>
#include<string.h>
void main()
{
int i;
FILE* fp;
char fileName[]={"name"};
char add[4]={'\0'};
char s[]={"C PROGRAMMING"};//sample text that has to be written into the file
for(i=0;i<10;i++)
{
add[0]=i;//is type conversion needed here ie. add[0]=(char)i; ???
printf("%c",add[0]);
strcat(fileName,add); //concatenating to change file name everytime
fp=fopen(fileName,"wt");
fprintf(fp,"%s",s);
fclose(fp);
}
}
the programming is running into an error state..