双向流

emerald 2001-05-23 01:45:00
定义 fstream f;
f.open("1.txt",ios_base::in|ios_base::out)在没有1.txt存在的
情况下,不会创建1.txt,为什么.
请各位大侠指教
...全文
84 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
emerald 2001-05-24
  • 打赏
  • 举报
回复
呵呵,多谢,看来我还要加强英文
holyfire 2001-05-24
  • 打赏
  • 举报
回复
它说是在这种模式下他使用了ios::nocreate尽管你没有设置这个标志。
emerald 2001-05-23
  • 打赏
  • 举报
回复
感谢你的回答,但这一段我没有看明白,是说我的mode不对,还是nocreate的关系?
希望能再听指教
holyfire 2001-05-23
  • 打赏
  • 举报
回复
Member functions and constructors of the form

(const char*, int mode, int prot = filebuf::openprot)

are used to open a file. The mode parameter can be set using the values in
the open_mode enumeration defined in class ios.

For example, the mode parameter could be

ios::binary|ios::in|ios::out.

The prot parameter corresponds to the access permission under DOS, and it is
used unless ios::nocreate is specified in mode.

The default parameter is set to read and write permission.

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧