Ofstream写文件
来源:互联网 发布:mysql端口的作用 编辑:程序博客网 时间:2024/06/14 06:38
#include <fstream>#include "iomanip"std::vector<double> vecSensorYcoordinate,vecSensorXcoordinate;//保存到txtvoid SaveToTXT(std::string m_outfilename){if (vecSensorYcoordinate.size() != vecSensorXcoordinate.size()){QMessageBox::critical(nullptr, "错误", ("解析数据的结果X和y的数量不匹配!"));return;}std::ofstream outfile;setlocale(LC_ALL, "Chinese-simplified");outfile.open(m_outfilename.c_str(), std::ios::out);setlocale(LC_ALL, "C");if (!outfile.is_open()){QMessageBox::critical(nullptr, "错误", ("信息存盘失败,请检查文件路径是否存在"));return;}outfile << "x" << "" << "y" << "\n";for (int i = 0; i < vecSensorXcoordinate.size(); i++){outfile << std::setiosflags(std::ios::fixed);outfile << std::setprecision(8);outfile << vecSensorXcoordinate[i] << "" << vecSensorYcoordinate[i] << "\n";}outfile.close();}
阅读全文
0 0
- ofstream写文件
- Ofstream写文件
- 入门计划->使用(C++库)ofstream写文件数据
- C++里Ofstream写文件的中文问题
- ofstream 处理wchar写文件保留unicode格式
- C++里Ofstream写文件的中文问题
- ofstream 处理wchar写文件保留unicode格式
- ofstream写、ifstream读
- C++ ofstream写文件时OD错误 ifstream读文件时0x20错误
- ofstream ifstream 文件操作
- ofstream ifstream 文件操作
- ofstream ifstream 文件操作
- ofstream ifstream 文件操作
- ofstream ifstream 文件操作
- ofstream建立文件问题
- ofstream ifstream 文件操作
- ofstream ifstream 文件操作
- ofstream修改文件
- 计算机组成原理(唐朔飞)
- Springboot中使用redis,配置redis的key value生成策略(解决编码问题)
- 谈谈UML之用例图(use cas diagrams)
- 双色球6+1Java模拟
- 2017-06-08
- Ofstream写文件
- 狗屎一样的React(第八节,React-router 4.0的使用姿势)
- Android 中UniverImageLoader的属性及使用
- 前端面试题
- Android之EditText特殊小技巧
- 在卷积神经网络训练过程中loss出现NaN的原因以及可以采取的方法
- 死锁问题?
- Chromium网页URL加载过程分析
- java 字符编码