c++文件流操作接口
起源
代码中文件写入失败,测试接口
参考博客
c++文件读写详解
测试代码
//main.cpp
#include
#include
using namespace std;
int main()
{
cout << "Main start running.." << endl;
ofstream imageOut;
string path = "./run.log";
imageOut.open(path, ios::out | ios::binary);
if (!imageOut.is_open())
{
cout << "Save image data to file failed, because open file failed." << endl;
return -1;
}
imageOut.write("h
c++文件流操作接口最先出现在Python成神之路。
共有 0 条评论