I have to open many small files in C. But the files are in the form a.001, a.002, .....a.00n.
I lke to open files in a loop.
like when int n = 1 open a.001
upto n=n open a.00n.
Can you please help me.
This is a discussion on open files in a loop in C within the C Programming forums, part of the General Programming Boards category; I have to open many small files in C. But the files are in the form a.001, a.002, .....a.00n. I ...
I have to open many small files in C. But the files are in the form a.001, a.002, .....a.00n.
I lke to open files in a loop.
like when int n = 1 open a.001
upto n=n open a.00n.
Can you please help me.
sprintf the filename and the number together and then use it to call fopen.
thank you very much