0
[HELP]How can I create lists with variable INT in the name using fopen() ?
3 ответов
0
please try the following:
#include <stdio.h>
#define FILE_NAME "list%d.txt"
int main() {
FILE *fpt;
int i;
char buf[255];
for(i=0;i<10;i++){
sprintf(buf, FILE_NAME, i);
fpt = fopen(buf, "w");
}
return 0;
}
0
Thank you, I have tried it, but it's not worked, warning '' the source file has not been compiled yet ''
0
Maybe your path is not full. Try entering the full path under the define