Creating dynamic file names?

Basically, I want to create a file name that contains a variable which I can assign. For example, say I wanted to create a file named "fileX.txt" where I can change the value of X so I could have "file1.txt" or "file2.txt". So, In a function, I plan on creating and writing to a file named "file1.txt" and the next time I call that function I want to create and write to a file named "file2.txt". I'm guessing I will need a global variable,int X , in order to keep track of which number file to create next. I understand how to create files and write to them, I'm just having trouble creating dynamic file names.

Thanks in advance!
Topic archived. No new replies allowed.