#include<iostream>
#include<vector>
#include<fstream>
#include<string>
using namespace std;
void main()
{
//string str("hello.txt\0");
char *a[] = {"1.txt\0","2.txt\0"}; //用于vector的初始化
vector<string> file_set(a, a+2);
for(unsigned i = 0; i < file_set.size(); ++i)
{
ofstream outfile(file_set[i]);
outfile << "hello?baby";
outfile.close();
}
}
#include<vector>
#include<fstream>
#include<string>
using namespace std;
void main()
{
//string str("hello.txt\0");
char *a[] = {"1.txt\0","2.txt\0"}; //用于vector的初始化
vector<string> file_set(a, a+2);
for(unsigned i = 0; i < file_set.size(); ++i)
{
ofstream outfile(file_set[i]);
outfile << "hello?baby";
outfile.close();
}
}