《C++大學教程(第6版)(英文版)(含CD光盤1張)》是一本C++編程方面的優秀教材,全面介紹了面向對象編程的原理和方法,詳細分析了與C++編程有關的技術,具體包括類與對象、控制語句、函數與遞歸、數組、指針、運算符重載、繼承、多態、模板、流輸入/輸出、異常處理、文件處理、搜索與排序、數據結構、標準模板庫等內容,本書的同步學習網站上還包含了更多的擴展內容。全書以“活代碼”方式詳細分析了每個知識要點,是初學者和中高級程序員學習C++編程的理想用書。 本書可作為高等院校相關專業的編程語言教材和C++編程教材,也是軟件設計人員學習C++編程的理想讀物。
通過完整,權哦性的DEITEL活代碼介紹C++,面向對象編程(OOP)和使用UML 2的面向對象設計(OOD)。C++是極受大家歡迎的面向對象程序設計語言之一。 盡早接觸類/對象/面向對象編程 類,對象,封裝 繼承,多態性 完整的面向對象編程實例研究: Time類,Grade Book類.Employee類 基礎知識 歷史。硬件,軟件 輸入/輸出流,類型,運算 控制語句,函數 數組,vector類模板 指針,引用 字符串類,C風格的字符串 運算符重載 異常處理,文件 一位運算及字符操作 GNU C++調試器與Visual Studio調試器 數據結構 遞歸,查找,排序 鏈表,隊列,堆棧,樹 模板 標準模板庫:容器,迭代器和算法 OOOD/UML2 ATM實例研究(選學) 確定類,屬性,狀態,活動。操作,協作 示圖:用例圖,類圖,狀態圖, 活動圖,通信圖,順序圖 開源的C++庫 使用Orge進行游戲編程 Boost C++庫與C++的將來 《C++大學教程(第六版)(英文版)》圍繞完整的實例研究。詳盡地講述C++面向對象編程。主要的實例研究包括:Grade Book類、Time類、Employee類以及可選學的OOD/UML2ATM系統。 《C++大學教程(第六版)(英文版)》的用戶資源包括Web站點,其中提供了教材中的代碼示例以及與教師、學生和專業人士相關的信息。
Paul J.Deitel和HarveyM.Deitel博士是Deitel&Associates公司的創立者,該公司是一家國際認可的企業培訓和媒體內容制作機構,主要針對C++、Java、C、C#、Visual Basic。.NET,Visual C++。.NET、XML、Python,Pen、Internes、Web和對象技術。Deitel父子編寫的其他許多教材都非常暢銷,包括《Java大學教程(第七版)》、《因特網和萬維網大學教程》和《C大學教程(第五版)》等。
Chapter 1 Introduction to Computers, the Internet and the World Wide Web
1.1 Introduction
1.2 What Is a Computer?
1.3 Computer Organization
1.4 Early Operating Systems
1.5 Personal, Distributed and Client/Server Computing
1.6 The Internet and the World Wide Web
1.7 Web 2.01
1.8 Machine Languages, Assembly Languages and High-Level Languages
1.9 History of C and C++
1.10 C++ Standard Library
1.11 History of Java
1.12 Fortran, COBOL, Pascal and Ada
1.13 BASIC, Visual Basic, Visual C++, C# and .NET
1.14 Key Software Trend: Object Technology
1.15 Typical C++ Development Environment
1.16 Notes About C++ and C++ How to Program, 6/e
1.17 Test-Driving a C++ Application
1.18 Software Technologies
1.19 Game Programming with the Ogre Libraries
1.20 Future of C++: Open Source Boost Libraries, TR1 and C++0x
1.21 Software Engineering Case Study:Introduction to Object Technology and the UML
1.22 Web Resources
Chapter 2 Introduction to C++ Programming
2.1 Introduction
2.2 First Program in C++: Printing a Line of Text
2.3 Modifying Our First C++ Program
2.4 Another C++ Program: Adding Integers
2.5 Memory Concepts
2.6 Arithmetic
2.7 Decision Making: Equality and Relational Operators
2.8 (Optional) Software Engineering Case Study: Examining the ATM Requirements Specification
Chapter 3 Introduction to Classes and Objects
3.1 Introduction
3.2 Classes, Objects, Member Functions and Data Members
3.3 Overview of the Chapter Examples
3.4 Defining a Class with a Member Function
3.5 Defining a Member Function with a Parameter
3.6 Data Members, set Functions and get Functions
3.7 Initializing Objects with Constructors
3.8 Placing a Class in a Separate File for Reusability
3.9 Separating Interface from Implementation
3.10 Validating Data with set Functions
3.11 (Optional) Software Engineering Case Study:
Identifying the Classes in the ATM Requirements Specification
Chapter 4 Control Statements: Part 1
4.1 Introduction
4.2 Algorithms
4.3 Pseudocode
4.4 Control Structures
4.5 i f Selection Statement
4.6 if…else Double-Selection Statement
4.7 while Repetition Statement .
4.8 Formulating Algorithms: Counter-Controlled Repetition
4.9 Formulating Algorithms: Sentinel-Controlled Repetition
4.10 Formulating Algorithms: Nested Control Statements
4.11 Assignment Operators
4.12 Increment and Decrement Operators
4.13 (Optional) Software Engineering Case Study: Identifying Class Attributes in the ATM System
Chapter 5 Control Statements: Part 2
5.1 Introduction
5.2 Essentials of Counter-Controlled Repetition
5.3 for Repetition Statement
5.4 Examples Using the for Statement
5.5 do...while Repetition Statement
5.6 switch Multiple-Selection Statement
5.7 break and continue Statements
5.8 Logical Operators
5.9 Confusing the Equality (==) and Assignment (=) Operators
5.10 Structured Programming Summary
5.11 (Optional) Software Engineering Case Study:
Identifying Objects' States and Activities in the ATM System
Chapter 6 Functions and an Introduction to Reeursion
6.1 Introduction
6.2 Program Components in C++
6.3 Math Library Functions
6.4 Function Definitions with Multiple Parameters
6.5 Function Prototypes and Argument Coercion
6.6 C++ Standard Library Header Files
6.7 Case Study: Random Number Generation
6.8 Case Study: Game of Chance; Introducing enum
6.9 Storage Classes
6.10 Scope Rules
6.11 Function Call Stack and Activation Records
6.12 Functions with Empty Parameter Lists
6.13 Inline Functions
6.14 References and Reference Parameters
6.15 Default Arguments
6.16 Unary Scope Resolution Operator
6 17 Function Overloading
6.18 Function Templates
6.19 Recursion
6.20 Example Using Recursion: Fibonacci Series
6.21 Recursion vs. Iteration
6.22 (Optional) Software Engineering Case Study: Identifying Class Operations in the ATM System
Chapter 7 Arrays and Vectors
7.1 Introduction
7.2 Arrays
7.3 Declaring Arrays
7.4 Examples Using Arrays
7.4.1 Declaring an Array and Using a Loop to Initialize the Array's Elements
7.4.2 Initializing an Array in a Declaration with an Initializer List ~ ~
7.4.3 Specifying an Array's Size with a Constant Variable and
Setting Array Elements with Calculations
7.4.4 Summing the Elements of an Array
7.4.5 Using Bar Charts to Display Array Data Graphically
7.4.6 Using the Elements of an Array as Counters
7.4.7 Using Arrays to Summarize Survey Results
7.4.9 Static Local Arrays and Automatic Local Arrays
7.5 Passing Arrays to Functions
7.6 Case Study: Class GradBeook Using an Array to Store Grades
7.7 Searching Arrays with Linear Search
7.8 Sorting Arrays with Insertion Sort
7.9 Multidimensional Arrays
7.10 Case Study: Class GradeBook Using a Two-Dimensional Array
7.11 Introduction to C++ Standard Library Class Template ve c t or
7.12 (Optional) Software Engineering Case Study: Collaboration Among Objects in the ATM System
Chapter 8 Painters and Painter-Based Strings
8.1 Introduction
8.2 Pointer Variable Declarations and Initialization
8.3 Pointer Operators
8.4 Passing Arguments to Functions by Reference with Pointers
8.5 Using const with Pointers
8.6 Selection Sort Using Pass-by-Reference .
8.7 sizeof Operator
8.8 Pointer Expressions and Pointer Arithmetic
8.9 Relationship Between Pointers and Arrays
8.10 Arrays of Pointers
8.11 Case Study: Card Shuffling and Dealing Simulation
8.12 Function Pointers
8.13 Introduction to Pointer-Based String Processing
8.13.1 Fundamentals of Characters and Pointer-Based Strings
8.13.2 String-Manipulation Functions of the String-Handling Library
Chapter 9 Classes: A Deeper Look, Part 1
9.1 Introduction
9.2 Time Class Case Study
9.3 Class Scope and Accessing Class Members
9.4 Separating Interface from Implementation
9.5 Access Functions and Utility Functions
9.6 Time Class Case Study: Constructors with Default Arguments
9.7 Destructors
9.8 When Constructors and Destructors Are Called
9.9 Time Class Case Study: A Subtle Trait——Returning a Reference to a private Data Member
9.10 Default Memberwise Assignment
9.11 (Optional) Software Engineering Case Study: Starting to Program the Classes of the ATM System.
Chapter 10 Classes: A Deeper Look, Part 2
10.1 Introduction
10.2 const (Constant) Objects and const Member Functions
10.3 Composition: Objects as Members of Classes
10.4 friend Functions and friend Classes
10.5 Using the this Pointer
10.6 Dynamic Memory Management with Operators new and delete
10.7 static Class Members
10.8 Data Abstraction and Information Hiding
10.8.1 Example: Array Abstract Data Type
10.8.2 Example: String Abstract Data Type
10.8.3 Example: Queue Abstract Data Type
10.9 Container Classes and Iterators
10.10 Proxy Classes
Chapter 11 Operator Overloading; String and Array Objects
11.1 Introduction
11.2 Fundamentals of Operator Overloading
11.3 Restrictions on Operator Overloading
11.4 Operator Functions as Class Members vs. Global Functions
11.5 Overloading Stream Insertion and Stream Extraction Operators
11.6 Overloading Unary Operators
……
Chapter 12 Object-0riented Programming:Inheritance
Chapter 13 Object-Oriented Programming:Polymorphism
Chapter 14 Templates
Chapter 15 Stream Input/Output
Chapter 16 Exception Handling
Chapter 17 File Processing
Chapter 18 Class string and String Stream Processing
Chapter 19 Searching and Sorting
Chapter 20 Data Structures
Chapter 21 Standard Template Library (STL)
Chapter 22 Game Programming with Ogre
Chapter 23 Boost Libraries, Technical Report I and C++0x
Chapter 24 Other Topics
Appendix A Operator Precedence and Associativity Chart
Appendix B ASCII Character Set
Appendix C Fundamental Types
Appendix D Number Systems
Appendix E C Legacy Code Topics
Appendix F Preprocessor
Appendix G ATM Case Study Code
Appendix H UML 2: Additional Diagram Types
Appendix I Using the Visual Studio Debugger
Appendix J Using the GNU C++ Debugger
Bibliography
Index
We do not list any operations for class ATM at this time. We are not yet aware of any services that class ATM provides toother classes in the system. When we implement the system with C++ code, however, operations of this class, andadditional operations of the other classes in the system, may emerge.Identifying and Modeling Operation ParametersSo far, we have not been concerned with the parameters of our operations——we have attempted to gain only a basicunderstanding of the operations of each class. Let's now take a closer look at some operation parameters. We identify anoperation's parameters by examining what data the operation requires to perform its assigned task. Consider the authenticateUser operation of class BankDatabase. To authenticate a user, this operation mustknow the account number and PIN supplied by the user. Thus we specify that operation authenticateOser takesinteger parameters userAccountNumber and userPIN, which the operation must compare to the account number andPIN of an Account object in the database. We prefix these parameter names with user to avoid confusion between theoperation's parameter names and the attribute names that belong to class Account. We list these parameters in the classdiagram in Fig. 6.36 that models only class BankDatabase.[Note: It is perfectly normal to model only one class in aclass diagram. In this case, we are most concerned with examining the parameters of this one class in particular, so weomit the other classes. In class diagrams later in the case study, in which parameters are no longer the focus of ourattention, we omit the parameters to save space. Remember, however, that the operations listed in these diagrams stillhave parameters.