转:C++创建txt文件并读写

转:c++ 批量创建txt文件

#include <iostream>
#include <fstream>
#include<string>
using namespace std;
//将int转为string类型,后可以操作。

int main(){
ofstream File;
 for(int i=0;i<100;i++)
 {
  string bb="";
  bb=to_string(static_cast<long long>(i));
  File.open("file_"+bb+".txt");
  File.close();
 }
 return 0;
}

转:C++文件读写详解(ofstream,ifstream,fstream)

转:C++文件操作:打开文件和写入文件

转:C++文件操作详解(ifstream、ofstream、fstream)

转:C++ 实现txt文件的读取

转:C++实现一行一行读取文本

转:C++批量生成与读写

猜你喜欢

转载自blog.csdn.net/qq_32642107/article/details/86681585