How to create custom filenames in C?
Posted
by eSKay
on Stack Overflow
See other posts from Stack Overflow
or by eSKay
Published on 2010-03-15T06:03:51Z
Indexed on
2010/03/15
6:09 UTC
Read the original article
Hit count: 192
Please see this piece of code:
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main() {
int i = 0;
FILE *fp;
for(i = 0; i < 100; i++) {
fp = fopen("/*what should go here??*/","w");
//I need to create files with names: file0.txt, file1.txt, file2.txt etc
//i.e. file{i}.txt
}
}
© Stack Overflow or respective owner