【发布时间】:2021-04-15 08:39:44
【问题描述】:
我试图在读写模式下创建一个文件,但它没有创建文件,可能是什么问题?
这是代码:
fstream file("NameFile.txt", ios::out| ios::in);
程序将启动,但不会创建任何文件。
【问题讨论】:
-
这能回答你的问题吗? std::fstream doesn't create file
-
这样它甚至不会创建任何东西。
fstream file;file.open("test.txt",ios::out | ios::in)