step1:包含头文件

step 2:代码
#include
#include
using namespace std;

int main(){

ofstream outfile;
outfile.open(“data.txt”, ofstream::app);
outfile << “data” << dis_xy[0] << endl;
// 关闭文档
outfile.close();

}
step3:运行结果 :
C++实现输出内容存入到TXT文档中

相关文章:

  • 2021-11-28
  • 2022-12-23
  • 2022-02-10
  • 2021-07-16
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-07
  • 2022-12-23
  • 2021-12-04
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案