1、读取
#include <fstream>
#include <iostream>
#include <string>
CString type_str[20];
std::ifstream file("ecat_type.txt"); // 打开文件第一行个数,第二行开始类型
if (!file.is_open())
{
//打开失败
for(int i=
本文介绍了如何使用C++的ifstream和ofstream在CString和std::string之间进行文件操作,包括从ecat_type.txt中读取类型数据并存储,以及在保存时清空并写入新的数据。
1、读取
#include <fstream>
#include <iostream>
#include <string>
CString type_str[20];
std::ifstream file("ecat_type.txt"); // 打开文件第一行个数,第二行开始类型
if (!file.is_open())
{
//打开失败
for(int i=
3280

被折叠的 条评论
为什么被折叠?