问题遇到的现象和发生背景
想问一下,这个为什么不显示数据,我另外用,ofstream,ifstream可以写入、读写,但是用这个fstream,读取都不成功,怎么解决?
```c++
#include <fstream>
#include <iostream>
//#inlude <conio.h>
using namespace std;
int main()
{
fstream f;
f.open("book.text");
if(!f.is_open())
{
cout<"不能打开文件";
}
else
cout<<"能打开文件";
return 0;
}
输出结果: