C++面向对象编程:英文版

C++面向对象编程:英文版
作 者: Ira Pohl
出版社: 电子工业出版社
丛编项: 国外计算机科学教材系列
版权说明: 本书为公共版权或经版权方授权,请支持正版图书
标 签: C++
ISBN 出版时间 包装 开本 页数 字数
未知 暂无 暂无 未知 0 暂无

作者简介

  美国加州大学SantaCruz校区计算机科学系的教授。他在软件方法学方面有二十多年的经验,是C++和C语言编程的国际权威。IraPohl曾兼任数字设备公司、苹果、斯坦福线性加速器中心、Xylinx、NationalTechnological大学和Gupta的顾问。

内容简介

本书面向有经验的编程人员,清晰、透彻地介绍了ANSIC++面向对象编程。书中讲述了支持面向对象编程概念的C++语言特性,包括STL、名称空间、RTTI以及布尔类型等新特性。IraPohl是C++方面的权威作家,在本书中以其著名的“剖析”方法展示了关键编程要素及惯用语言,教你如何权衡以及做出最恰当的选择。美国加州大学SantaCruz校区计算机科学系的教授。他在软件方法学方面有二十多年的经验,是C++和C语言编程的国际权威。IraPohl曾兼任数字设备公司、苹果、斯坦福线性加速器中心、Xylinx、NationalTechnological大学和Gupta的顾问。本书旨在介绍使用ANSIC++进行面向对象的编程,解释在此环境中的C++特性。书中提供STL、名称空间、RTTI以及布尔类型等C++最新特性的快速指南,借助大量示例展示优秀的编程风格。全书重点介绍了C++的数据结构、标准模板库以及C++语言的主流方向和习惯用法。具体包括基本类型和语句、功能和指示器、数据隐藏、多态性、迭代器和容器、继承等多项内容。本书面向有编程经验的学生和其他读者,可作为应?肅++语言讲授的高级编程、数据结构、软件设计方法学等课程的教材。

图书目录

1 Why Object-Oriented Programming in C++?

1.1 Object-Oriented Programming

1.2 An Example C++ Program

1.3 Encapsulation and Type-Extensibility

1.4 Constructors and Destructors

1.5 Overloading

1.6 Templates and Generic Programming

1.7 The Standard Template Library (STL)

1.8 Inheritance

1.9 Polymorphism

1.10 C++ Exceptions

1.11 Benefits of Object-Oriented Programming.

2 Native Types and Statements

2.1 Program Elements

2.2 Input/Output

2.3 Program Structure

2.4 Simple Types

2.5 The Traditional Conversions

2.6 Enumeration Types

2.7 Expressions

2.8 Statements

2.9 Pragmatics

Summary

Exercises

3 Functions and Pointers

3.1 Functions

3.2 Function Definition

3.3 The return Statement

3.4 Function Prototypes

3.5 Default Arguments

3.6 Overloading Functions

3.7 Inlining

3.8 Scope and Storage Class

3.9 Namespaces

3.10 Pointer Types

3.11 The Uses of void

3.12 Arrays and Pointers

3.13 The Relationship between Arrays and Pointers

3.14 Passing Arrays to Functions

3.15 Reference Declarations and Call-by-Reference

3.16 Assertions and Program Correctness

3.17 Strings: The char* Convention

3.18 Multidimensional Arrays

3.19 Free Store Operators new and delete

3.20 Pragmatics

4 Implementing ADTs in the Base Language

4.1 The Aggregate Type struct

4.2 Structure Pointer Operator

4.3 An Example: Stack

4.4 Unions

4.5 Complex Numbers

4.6 Example: A Flush

4.7 Bit Fields

4.8 An Example: Two-Dimensional Dynamic Arrays

4.9 Pragmatics

Summary

Exercises

5 Data Hiding and Member Functions

5.1 Member Functions

5.2 Access: Private and Public

5.3 Classes

5.4 Class Scope

5.5 Example: Revisiting the Flush

5.6 static Member

5.7 The this Pointer

5.8 static and const Member Functions

5.9 Containers and Item Access

5.10 Pragmatics

Summary

Exercises

6 Object Creation and Destruction

6.1 Classes with Constructors

6.2 Constructing a Dynamically Sized Stack

6.3 Classes with Destructors

6.4 An Example: Dynamically Allocated Strings

6.5 AClass vect

6.6 Members that Are Class Types

6.7 Example: A Singly Linked List

6.8 Two-Dimensional Arrays

6.9 Polynomials as a Linked List

6.10 Strings Using Reference Semantics

6.11 No Constructor, Copy Constructor, and Other Mysteries,

6.12 Pragmatics

Summary

Exercises

7 Ad Hoc Polymorphism

7.1 ADT Conversions

7.2 Overloading and Function Selection

7.3 Friend Functions

7.4 Overloading Operators

7.5 Unary Operator Overloading

7.6 Binary Operator Overloading

7.7 Overloading Assignment and Subscripting Operators

7.8 Polynomial: Type and Language Expectations

7.9 Overloading I/O Operators <>

7.10 Overloading Operator () for Indexing

7.11 Pointer Operators

7.12 Overloading new and delete

7.13 Pragmatics

Summary

Exercises

8 Visitation: lterators and Containers

8.1 Visitation

8.2 Iterators

8.3 An Example: quicksort()

8.4 Friendly Classes and Iterators

8.5 Generic Programming with roi d*

8.6 List and List Iterator

8.7 Pragmatics

Summary

Exercises

9 Templates, Generic Programming, and STL

9.1 Template Class stack

9.2 Function Templates

9.3 Class Templates

9.4 Parameterizing the Class vector

9.5 Parameterizing qui cksort()

9.6 Parameterized Binary Search Tree

9.7 STL

9.8 Containers

9.9 Iterators

9.10 Algorithms

9.11 Functions

9.12 Function Adaptors

9.13 Pragmatics

Summary

Exercises

10 Inheritance

10.1 A Derived Class

10.2 Typing Conversions and Visibility

10.3 Code Reuse: A Binary Tree Class

10.4 Virtual Functions

10.5 Abstract Base Classes

10.6 Templates and Inheritance

10.7 Multiple Inheritance

10.8 Inheritance and Design

10.9 Run-Time Type Identification

10.10 Pragmatics

Summary

Exercises

11 Exceptions

11.1 Using assert.h

11.2 Using signa.h

11.3 C++ Exceptions

11.4 Throwing Exceptions

11.5 Try Blocks

11.6 Handlers

11.7 Exception Specification

11.8 terminate() and unexpected()

11.9 Example Exception Code

11.10 Standard Exceptions and their Uses

11.11 Pragmatics

Summary

Exercises

12 OOP Using C++

12.1 OOP Language Requirements

12.2 ADTs in Non-OOP Languages

12.3 Clients and Manufacturers

12.4 Reuse and Inheritance

12.5 Polymorphism

12.6 Language Complexity

12.7 C++ OOP Bandwagon

12.8 Platonism: Tabula Rasa Design

12.9 Design Principles

12.10 Schema, Diagrams, and Tools

12.11 Design Patterns

12.12 C++: A Critique

Summary

Exercises

A ASCII Character Codes

B Operator Precedence and Associativity

C Language Guide

C.1 Program Structure

C.2 Lexical Elements

C.3 Constants

C.4 Declarations and Scope Rules

C.5 Namespaces

C.6 Linkage Rules

C.7 Types

C.8 Conversion Rules and Casts

C.9 Expressions and Operators

C.10 Statements

C.11 Functions

C.12 Classes

C.13 Inheritance

C.14 Template

C.15 Exceptions

C.16 Caution and Compatibility

C.17 New Features in C++

D Input/Output

D.1 The Output Class ostream

D.2 Formatted Output and iomanip.h

D.3 User-Defined Types: Output

D.4 The Input Class istream

D.5 Files

D.6 Using Strings as Streams

D.7 The Functions and Macros in ctype.h

D.8 Using Stream States

D.9 Mixing I/O Libraries

E STL and String Libraries

E.1 Containers

E.2 Iterators

E.3 Algorithms

E.4 Functions

E.5 Allocators

E.6 String Library

References

Index