什么是fstream对象?输出文件而不是实际文件流的对象,还是代表文件流?
FSTREAM代表所有输入和输出文件流,对吗?当我创建一个ofstream对象时,我是在创建一个可以用来输出到文件的对象(实际上不代表文件流)还是我在创建文件流?当我调用函数std :: ofStream :: Open
时,它会创建从ofstream对象到我指定的文件的流来源吗?
fstream represents all the input and output file streams right? When I create an ofstream object, am I creating an object that can be used to output to files (doesn't actually represent the file stream) or am I creating a file stream? When I call the function std::ofstream::open
, it creates the stream from the ofstream object to the file I specify right?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“文件流”是一个概念。创建一个
std :: Ofstream
的对象时,可以创建一个“流”,但它并不是立即与文件相关的。您可以在创建时“关联”它(通过将文件指定为构造函数参数),也可以使用std :: ofStream :: Open
使用单独的操作。"File stream" is a concept. You create a "stream" when you create an object of
std::ofstream
but it's not neccessarily associated with a file straight away. You can "associate" it either upon creation (by specifying the file as a constructor argument) or as a separate operation with use ofstd::ofstream::open