输入、输出流部分内容

流插入运算符<<属于输出流。流读取运算符>>属于输入流

一、输出流:

1、流插入运算符<<输出标准类型;

2、用put成员函数输出字符;

cout.put(‘A’).put(‘/n’);

3、用write成员函数实现无格式输出;

4、以十进制、八进制、十六进制方式输出整数;

5、以各种精度方式输出浮点数;

6、强制输出带有小数点的浮点数;

7、以科学计数法和定点计数法表示浮点数;

8、在指定宽度的区域内对齐输出浮点数;

9、在区域内用特定字符填充;

10、以科学计数法和十六进制计数法输出大写字母;

二、输入流:

1、get、getline成员函数;

下面是关于get的一些介绍:

int_type get();
basic_istream& get(
    Elem& _Ch
);
basic_istream& get(
    Elem *_Str,
    streamsize _Count
);
basic_istream& get(
    Elem *_Str,
    streamsize _Count,
    Elem _Delim
);
basic_istream& get(
    basic_streambuf& _Strbuf
);
basic_istream& get(
    basic_streambuf& _Strbuf,
    Elem _Delim
);
getline的介绍:
basic_istream& getline(
    char_type *_Str, 
    streamsize _Count
);
basic_istream& getline(
    char_type *_Str, 
    streamsize _Count, 
    char_type _Delim
);

Parameters
_Count

The number of characters to read from strbuf.

_Delim

The character that should terminate the read if it is encountered before _Count.

_Str

A string in which to write.

_Ch

A character to get.

_Strbuf

A buffer in which to write.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值