Cpp Standard Library 简明教程

C++ Library - <iostream>

Description

它用于标准输入/输出流库。

Declaration

下面是 iosstream 函数的声明。

C++98

Including this header may automatically include other headers, such as <ios>,
   <streambuf>, <istream>, <ostream> and/or <iosfwd>.

C++11

Including <iostream> automatically includes also <ios>, <streambuf>, <istream>,
   <ostream> and <iosfwd>.

Objects

iostream 的对象应当如下:

Narrow characters (char)

Sr.No.

Characters

Definition

1

cin

Standard input stream

2

cout

Standard output stream

3

cerr

用于错误的标准输出流

4

clog

用于日志记录的标准输出流

Wide characters (wchar_t)

Sr.No.

Characters

Definition

1

wcin

Standard input stream (wide)

2

wcout

SStandard output stream (wide)

3

wcerr

用于错误的标准输出流(宽)

4

wclog

用于日志记录的标准输出流(宽)