Skip to Content
C++语言导学(原书第2版)
book

C++语言导学(原书第2版)

by 本贾尼 斯特劳斯特鲁普
August 2021
Intermediate to advanced
450 pages
5h 35m
Chinese
Pearson
Content preview from C++语言导学(原书第2版)

10.11 建议

[1] iostream是类型安全、类型敏感且易扩展的;10.1节。

[2] 仅当迫不得已时才使用字符级别的输入;10.3节;[CG:SL.io.1]。

[3] 当读取数据时,总是要考虑不规范的输入;10.3节;[CG:SL.io.2]。

[4] 避免使用endl(如果你不知道endl是什么,你什么也没错过);[CG:SL.io.50]。

[5] 如果用户自定义类型的值存在有意义的文本表示形式,我们可以为它定义<<和>>操作;10.1节、10.2节和10.3节。

[6] cout用于标准输出,cerr用于报告错误;10.1节。

[7] 标准库提供了用于普通字符和宽字符的iostream,而且你可以为任何字符类型定义iostream;10.1节。

[8] 标准库支持二进制I/O;10.1节。

[9] 标准库提供了用于标准I/O流、文件和string的标准iostream;10.2节、10.3节、10.7节和10.8节。

[10] 将<<操作链接起来可以简化输出语句;10.2节。

[11] 将>>操作链接起来可以简化输入语句;10.3节。

[12] 不断读取输入存入string中不会导致溢出;10.3节。

[13] 默认情况下>>会跳过起始空白符;10.3节。

[14] 使用流状态fail处理可恢复的I/O错误;10.4节。

[15] 你可以为自己的类型定义<<和>>运算符;10.5节。

[16] 你无须修改istream和ostream来添加新的<<和>>运算符;10.5节。

[17] 使用操纵符控制格式;10.6节。

[18] precision()说明对后续浮点输出操作一直有效;10.6节。

[19] 浮点格式说明(如scientific)对后续浮点输出操作一直有效;10.6节。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

软件开发实践:项目驱动式的Java开发指南

软件开发实践:项目驱动式的Java开发指南

Raoul-Gabriel Urma, Richard Warburton
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey
Python机器学习案例精解

Python机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu

Publisher Resources

ISBN: 9787111633280