eϊΙFileπμ¬·ι
#include stdio.h> #include stdlib.h> main(){ int x; FILE *fp; char name[100]; for(x=0;x10;x++) { sprintf (name,"%d.dat", x); if ( (fp=fopen (name,"wt"))==NULL){ fprintf (stderr, "error\n"); exit(1); } fprintf (fp,"%07d", x); fclose (fp); } return 0; }
[oΝΚ]
t@CF10Βμ¬ (0.dat, 1.dat, ..., 10.dat)
g 0.dat 0000000, 1.dat 0000001
Back to C Language