ios :: app和ios :: ate之间的区别 [英] Difference between ios::app and ios::ate

查看:1125
本文介绍了ios :: app和ios :: ate之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

C ++ Filehandling:ios:app和ios:ate之间的区别?

Possible Duplicate:
C++ Filehandling: Difference between ios:app and ios:ate?

这两种文件打开模式之间有什么区别?

What is the difference between these two file opening modes ?

ios:ate将get / put指针位置设置为文件末尾= >读/写将
从结束开始,但它是如何不同于ios :: app,它再次打开一个附加模式下的文件...但是当我创建了一个stream并打开它在ios:app模式,put stream指针仍然指向开始,那么附加工作怎么样呢?

ios:ate sets the get/put pointer position to the end of the file => reading/writing will begin from end, but how is it different from ios::app, which again opens a file in append mode...but when I have created a ofstream and opened it in ios:app mode, the put stream pointer still points to the beginning, how does the appending work then ?

我也理解ifstream,stream和fstream是高级类来管理底层流缓冲器。

Also I understand that ifstream, ofstream and fstream are high level classes to manage the underlying stream buffer. So does it mean that even in ios:app mode i can read data from a file ?

推荐答案

app 来自'append',所有输出将被添加(附加)到文件的末尾。

app comes from 'append'- all output will be added (appended) to the end of the file. In other words you cannot write anywhere else in the file but at the end

ate 来自end - 当您打开文件时,它会在文件末尾设置流位置,但您可以随意移动它(寻找),并随意写入。

ate come form 'at end' - it sets the stream position at the end of the file when you open it but you are free to move it around (seek) and write wherever it pleases you.

这篇关于ios :: app和ios :: ate之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆