#include <iostream>
#include <fstream>册宽
#include <sstream>
using namespace std;
int main(){
ifstream inf;
ofstream ouf;
stringstream sstr;
for(int i=1;i<5;i++){
sstr<<"E:\new\"<<i;
cout<<sstr.str()<<endl;//
ouf.open(sstr.str().c_str());//sstr.str()返回值为string
sstr.str("");//清零
ouf.close();//关闭打开文件1的文件流烂迹,之后才能打州历亮开文件2
}
return 0;
}
当文件路径名包含汉字时,一个文件也创建不成功,不知你是怎么创建成功1个文件的