C++文件读写详解(ofstream,ifstream,fstream)及C++ string类.docxVIP

  • 12
  • 0
  • 约1.64万字
  • 约 14页
  • 2019-10-27 发布于湖北
  • 举报

C++文件读写详解(ofstream,ifstream,fstream)及C++ string类.docx

在看C++编程思想中,每个练习基本都是使用ofstream,ifstream,fstream,以前粗略知道其用法和含义,在看了几位大牛的博文后,进行整理和总结: 这里主要是讨论fstream的内容: [java] \o view plain view plain \o copy copy \o print print \o ? ? #include?fstream?? ofstream?????????//文件写操作?内存写入存储设备??? ifstream?????????//文件读操作,存储设备读区到内存中?? fstream??????????//读写操作,对打开的文件可进行读写操作??? 1.打开文件 在fstream类中,成员函数open()实现打开文件的操作,从而将数据流和文件进行关联,通过ofstream,ifstream,fstream对象进行对文件的读写操作 函数:open() [cpp] \o view plain view plain \o copy copy \o print print \o ? ? span?style=font-family:?Times?New?Roman;?font-size:?16px;?? public?member?function?? ?? void?open?(?const?char?*?filenam

文档评论(0)

1亿VIP精品文档

相关文档