How to generate several files in C -
I want to generate 60 files, program0.txt, .., program59.txt how can I do this?
My attempt:
FILE * fp [60]; (I = 0; i & lt; 60; i ++) {FP [i] = FOPAN ("program.txt", "w"); Fprintf (fp [i], "zero = ["]; }
file name [] using filenames below
Four filenames [15]; Int i; (I = 0; i & lt; 60; ++ i) {sprintf (filename, "program% 02d.txt", i); // printf ("% s \ n", file name); / * Fp [i] = Fopen (filename, "W"); .... Falcos (FP [Ii]); * /}
Comments
Post a Comment