#include <iostream>
#include <string.h>
#include <stdio.h>
#include <windows.h>
#include <fstream>
using namespace std;
int main(int argc,char *argv)
{
ofstream myfile;
std::string name_file = "cooldude";
int name_file_num = 1;
std::string name_file_ext = ".txt";
for (int i = 0;i < 10;i++)
{
myfile.open(name_file + name_file_num + name_file_ext);
}
myfile << "lol, it would be cool";
myfile.close();
system("pause");
}
Now you see here is that the code i showed wont compile for the following reason:
myfile.open(name_file + name_file_num + name_file_ext);
But this will give you a idea of what i want it to do, so basicly it would be: cooldude1.txt


Sign In
Create Account



Back to top









