TCPL_21 streams

What you see is all you get.

21.1 Introduction

设计和实现general input/output facility为一个编程语言是非常难的。传统上,I/O被设计成只处理内置类型。c++允许自定义类型,这些类型的输入输出必须被处理,被考虑进来。I/O设备必须,简单,方便,安全,效率高,flexible灵活。最重要的是全面的,完善的complete。没有人能够come up一个解决方案,满足所有的人。It should therefore be possible for a user to provide alternative I/O facilities and to extend the standard I/O facilities to cope with special applications.

C++允许用户自定义类型,这些类型可以像内置类型一样高效和使用方便。It is therefore a reasonable requirement that an I/O facility ofr C++ should be provided in C++ using only facilities available to every programmer.输入输出流设备就是为了满足这些要求的努力产生的结果。

$21.2 output:What the application programmer thinks of as output is really the conversion of objects of types, such as int, char*, and Emplyee_record, into sequences of characters. The facilities for writing built-in and user-defined types to output are described.

$21.3 Input:The facilities for requesting input of characters, string, and values of other built-in and user-defined types are presented.

$21.4 Formatting: There are often specific requirements for the layout of the output.

$21.5 Files and Streams: By default every C++ program can use standard streams, such as standard output(cout), standard input(cin), and error output(cerr). To use other devices or files, streams must be created and attached to those files or devices. The mechanisms for opening and closing files and for attaching streams to files and strings are described.

$21.6 Buffering: To make I/O efficient, we must use a buffering strategy that is suitable for both the data written(read) and the destination it is written to (read from). The basic techniques for buffering are presented.

$21.7 Locale:

$21.8 C I/O:

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值