编辑: 达达恰西瓜 | 2015-08-25 |
t changed from earlier versions is that the book remains a comprehensive tutorial introduction to C++. Our intent is to provide a clear, complete and correct guide to the language. We teach the language by presenting a series of examples, which, in addition to explaining language features, show how to make the best use of C++. Although knowledge of C (the language on which C++ was originally based) is not assumed, we do assume the reader has programmed in a modern block-structured language. 万变不离其宗,本书保持了前几版的特色,仍然是一部全面介绍 C++ 的教程.我们的目标是提供一本清晰、全面、准确的指南性读物.我们通过讲解一系列示例来教授 C++ 语言,示例除了解释语言特征外,还展示了如何善用这门语言.虽然读者不需要事先学过 C 语言(C++ 最初的基础)的知识,但我们假定读者已经掌握了一种现代结构化语言. Structure of This Book 本书结构 C++ Primer provides an introduction to the International Standard on C++, covering both the language proper and the extensive library that is part of that standard. Much of the power of C++ comes from its support for programming with abstractions. Learning to program effectively in C++ requires more than learning new syntax and semantics. Our focus is on how to use the features of C++ to write programs that are safe, that can be built quickly, and yet offer performance comparable to the sorts of low-level programs often written in C. 本介绍了 C++ 国际标准,既涵盖语言的特征,又讲述了也是标准组成部分的丰富标准库.C++ 的强大很大程度上来自它支持抽象程序设计.要学会用 C++ 高效地编程,只是掌握句法和语义是远远不够的.我们的重点在于,教会读者怎样利用 C++ 的特性,快速地写出安全的而且性能可与 C 语言低层程序相媲美的程序. C++ is a large language and can be daunting to new users. Modern C++ can be thought of as comprising three parts: C++ 是一种大型的编程语言,这可能会吓倒一些新手.现代 C++ 可以看成由以下三部分组成: The low-level language, largely inherited from C 低级语言,多半继承自 C. More advanced language features that allow us to define our own data types and to organize large-scale programs and systems 更高级的语言特征,用户可以借此定义自己的数据类型,组织大规模的程序和系统. The standard library, which uses these advanced features to provide a set of useful data structures and algorithms 标准库,使用上述高级特征提供一整套有用的数据结构和算法. Most texts present C++ in this same order: They start by covering the low-level details and then introduce the the more advanced language features. They explain the standard library only after having covered the entire language. The result, all too often, is that readers get bogged down in issues of low-level programming or the complexities of writing type definitions and never really understand the power of programming in a more abstract way. Needless to say, readers also often do not learn enough to build their own abstractions. 多数 C++ 教材按照下面的顺序展开:先讲低级细节,再介绍更高级的语言特征;
在讲完整个语言后才开始解释标准库.结果往往使读者纠缠于低级的程序设计问题和复杂类型定义的编写等细节,而不能真正领会抽象编程的强大,更不用说学到足够的知识去创建自己的抽象了. In this edition we take a completely different tack. We start by covering the basics of the language and the library together. Doing so allows you, the reader, to write significant programs. Only after a thorough grounding in using the library and writing the kinds of abstract programs that the libary a........