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版)

16.5 建议

[1] ISO C++标准[C++,2017]定义了C++。

[2] 当为一个新项目选择一种风格时,或是对一个代码库进行现代化时,依靠C++核心准则;16.1.4节。

[3] 当学习C++时,不要孤立地关注单个语言特性;16.2.1节。

[4] 不要陷入几十年之久的古老的语言特性集和设计技术中;16.4.1节。

[5] 在产品级代码中使用新特性之前,先进行试验,编写一些小程序,测试你计划使用的C++实现与标准是否一致,性能是否满足要求。

[6] 学习C++时,使用你能得到的最新的、最完整的标准C++实现。

[7] C和C++的公共子集并非学习C++的最好起点;16.3.2.1节。

[8] 优先选择命名类型转换,如static_cast,而非C风格类型转换;16.2.7节。

[9] 当你将一个C程序改写为C++程序时,首先检查函数声明(原型)和标准头文件的使用是否一致;16.3.2节。

[10] 当你将一个C程序改写为C++程序时,重新命名与C++关键字同名的变量;16.3.2节。

[11] 出于移植性和类型安全的考虑,如果你必须使用C,应使用C和C++的公共子集编写程序;16.3.2.1节。

[12] 当你将一个C程序改写为C++程序时,将malloc()的结果转换为恰当的类型,或者索性将所有malloc()都改为new;16.3.2.2节。

[13] 当你用new和delete替换malloc()和free时,考虑使用vector、push_back()和reserve()而不是realloc();16.3.2.1节。

[14] C++不允许int到枚举类型的隐式类型转换,如果必须进行这种转换,使用显式类型转换。

[15] 每个标准C头文件<X.h>都将名字定义在全局名字空间中,对应的C++头文件<cX>则将名字定义在名字空间std中。 ...

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