Yulin Chang <yc****@artsci.wustl.edu> writes:
I want to have variables in the name of the file created. like if i=3,
then I would like the 3rd file to have the name "file3". How do I do that
using fopen statement?
Construct the name of the file using string manipulation
functions; e.g.
sprintf(filename, "file%d", number);
then use fopen() with the constructed filename as an argument.
By the way, fopen() is a function, not a statement.
--
"It wouldn't be a new C standard if it didn't give a
new meaning to the word `static'."
--Peter Seebach on C99