小兔网


Deprecated: Required parameter $toggle follows optional parameter $filterGroups in /home/wwwroot/ixiaotu.com/plugins/content/easycontentrestriction/easycontentrestriction.php on line 289

Deprecated: Required parameter $subnum follows optional parameter $n in /home/wwwroot/ixiaotu.com/plugins/content/easycontentrestriction/aop/AopClient.php on line 802

Deprecated: Required parameter $charset follows optional parameter $n in /home/wwwroot/ixiaotu.com/plugins/content/easycontentrestriction/aop/AopClient.php on line 802

Deprecated: Required parameter $length follows optional parameter $start in /home/wwwroot/ixiaotu.com/plugins/content/easycontentrestriction/aop/AopClient.php on line 815

通常情况下,C++ 程序中使用 cin 输入流实现数据的输入,用 cout 输出流实现数据的输出。除此之外,C++ 还提供有适用于特定场景的输入输出流,比如 cerr、clog 等。

C++输入输出流本质上就是已经定义好的类对象,之所以称它们为"流",C++ 开发者认为数据传输(包含输入和输出)的过程像水一样,从一个地方流到另一个地方,所以称实现输入的为输入流,实现数据输出的为输出流。

作为类对象,C++输入流和输出流不仅可以实现基本的输入输出操作,通过类内部的成员函数,还可以满足特殊场景中的输入输出需求,这些知识在本章中都会做详细讲解。