filestream help

closed account (48CM4iN6)
Is there a way to create different files in a loop?
ex. a1.txt ,a2.txt ,a3.txt .

1
2
3
4
5
6
7
for (int i=0; i<someNumber; ++i)
{
  string filename("a");
  filename = filename + itoa(i);
  filename = filename + ".txt";
  // Now the filename is a0.txt, or a1.txt, or a2.txt etc etc
}

closed account (48CM4iN6)
An error occurs. It says that itoa doesn't take 0 parameters.
Last edited on
http://cplusplus.com/reference/clibrary/cstdlib/itoa/
This function [itoa] is not defined in ANSI-C and is not part of C++

For alternatives http://www.cplusplus.com/articles/D9j2Nwbp/
Topic archived. No new replies allowed.