网站大量收购独家精品文档,联系QQ:2885784924

C语言面向对象程序设计5.ppt

  1. 1、本文档共36页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
C语言面向对象程序设计5

* 6. I/O流与文件 (I/O Stream and File) 流--指字节序列,用于内存与外设缓冲区之间交换数据 I----Input(输入); O----Output(输出) 6.1 标准I/O流类和对象 标准I/O流:输入输出设备为键盘和显示器(打印机):cout,cin,cerr,clog 串流: 读写字符数组流(即把字符串看成为设备) 文件I/O流:永久存储介质设备上的数据组织为文件,如硬盘、软盘、光盘等 显示器 键盘 内存 输出O 输入I 外存 内存 写入O 读出I 内存 内存 字符数组 写入O 读出I 标准I/O流 串流 文件I/O流 istrstream类 ios类 istream类 ostream类 iostream类 ifstream类 ofstream类 fstream类 virtual public virtual public 多重继承 ostrstream类 strstream类 include文件: ios.h istream.h ostream.h iostream.h fstream.h strstrea.h 系统定义四个全局对象: cin, cout, cerr, clog, 用于处理标准I/O流 istream.h文件中定义 extern istream_withassign _CRTIMP cin; ostream.h文件中定义 extern ostream_withassign _CRTIMP cout; extern ostream_withassign _CRTIMP cerr; extern ostream_withassign _CRTIMP clog; ios基类以及派生类定义了系统提供的关于流处理的接口 ostream.h文件中的部分内容: class _CRTIMP ostream : virtual public ios { //为了多重继承的正确,用virtual public: ostream(streambuf*); virtual ~ostream(); //虚函数, 可以多态地撤销对象 ostream flush(); int opfx(); void osfx(); inline ostream operator (ostream (__cdecl * _f)(ostream)); //重载运算符, inline ostream operator (ios (__cdecl * _f)(ios)); //可处理各种数据类型 ostream operator (const char *); inline ostream operator (const unsigned char *); inline ostream operator (const signed char *); inline ostream operator (char); ostream operator (unsigned char); inline ostream operator (signed char); ostream operator (short); ostream operator (unsigned short); ostream operator (int); ostream operator (unsigned int); ostream operator (long); ostream operator (unsigned long); inline ostream operator (float); ostream operator (double); ostream operator (long double); ostream operator (const void *); ostream operator (streambuf*); inline ostream put(char); ostream put(unsigned char); inline ostream put(signed char); ostream write(const

文档评论(0)

zhuliyan1314 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档