I\'m trying to write a program in C++, which creates some files (.txt) and writes down the result in them. The problem is that an amount of these files is not fixed at the begin
for(int i=0; i!=n; ++i) { //create name std::string name="file_" + std::to_string(i) + ".txt"; // C++11 for std::to_string //create file std::ofstream file(name); //if not C++11 then std::ostream file(name.c_str()); //then do with file }