Say I have a char array of file names, how would I use them with a fucntion like fprintf? For example, I have a loop that runs ten times, and each time I want to print to a different file. How do I convert strings into filenames that fprintf can use, or is there an easier way to do this?
Thanks for you help.
If you want to write to a file, you must first open it.
Right, I've opened ten files that have corresponding names to the ten entries in a char array. How use the strings to access the files though?
An array of FILE* as well perhaps?
fp[ i ] = fopen( filename[ i ], "w" );