0
my dear friends, how to create multiple files(.txt) with different names(same folder) for read and write using c language.
This is my test case code, I just wanna try how the output will be seen...
5 Antworten
0
using w+ should do
0
Thanks, but how can i create multiple files using for loop
0
you would have to do some research but i know its possible
0
i think it was using sprintf or something like that
0
FILE *files[50];
for (int i = 0; i < 50; i++)
{
char filename[20];
sprintf(filename, "results%d.dat", i);
files[i] = fopen(filename, "w");
}
I want to create files with in one folder how can i
Like: new folder/newfile.txt, newfile2.txt, newfie3.txt........