C++面向對象程式設計(第4版)

C++面向對象程式設計(第4版)

《C++面向對象程式設計(第4版)》是2009年由清華大學出版社出版的圖書,作者是(印)巴拉古路薩米。

基本介紹

  • 中文名:C++面向對象程式設計(第4版)
  • 作者:(印)巴拉古路薩米
  • 出版社:清華大學出版社
  • 出版時間:2009年9月8日
  • 定價:66 元
  • 裝幀:平裝
  • ISBN:9787302207320
圖書簡介,圖書目錄,

圖書簡介

本書以一種簡單易懂的寫作風格,介紹了何謂C++面向對象程式設計、為什麼以及如何用C++進行面向對象程式設計。書給出了大量的示例、演示說明以及完整的程式。這些示例程式既簡單也很具有教學意義。在必要的時候,本書還使用了概念圖,使得介紹更加清晰,便於更好地理解。本書還介紹了面向對象方法的概念,簡要討論了系統的面向對象分析與設計的重要內容。本書的最大亮點是附錄A的兩個新的程式設計項目:(1)基於選單的計算系統;(2)銀行系統。它們演示了如何在現實應用程式中集成C++的各種特性。
本書不僅可以作為高等院校C++面向對象程式設計的教材,也是希望了解C++語言和面向對象程式設計知識的專業人員的很好參考書。

圖書目錄

Preface xiii
1.1 Software Crisis 1
1.2 Software Evolution 3
1.3 A Look at Procedure-Oriented Programming 4
1.4 Object-Oriented Programming Paradigm 6
1.5 Basic Concepts of object-Oriented Programming 7
1.6 Benefits of OOP 12
1.7 Object-Oriented Languages 13
1.8 Applications of OOP 14
Summary 15
Review Questions 17
2.1 Whatis C++? 19
2.2 Applications of C++ 20
2.3 A Simple C++ Program 20
2.4 More C++ Statements 25
2.5 An Example with Class 28
2.6 Structure of C++ Program 29
2.7 Creating the Source File 30
2.8 Compiling and Linking 30
Summary 31
Review Questions 32
Debugging Exercises 33
Programming Exercises 34
3.1 Introduction 35
3.2 Tokens 36
3.3 KeyWords 36
3.4 Identifiers and Constants 36
3.5 Basic Data Types 38
3.6 User-Defined Data Types 40
3.7 DeriVed Data Types 42
Vi Contents
3.8 SymbolicConstants 43
3.9 Type Compatibility 45
3.10 Declaration of Variables 45
3.11 Dynamic initialization of Variables 46
3.12 Reference Variables 47
3.13 Operators in C++ 49
3.14 Scope Resolution Operator 50
3.15 Member Dereferencing Operators 52
3.16 Memory Management Operators 52
3.17 Manipulators 55
3.18 Type Cast Operator 57
3.19 EXPressions and their Types 58
3.20 SpecialAssignment Expressions 60
3.21 Implicit Conversions 61
3.22 Operator Overloading 63
3.23 Operator Precedence 63
3.24 Control Structures 64
Summary 69
Review Questions 71
Debugging Exercises 72
Programming Exercises 75
4.1 Introduction 77
4.2 The Main Function 78
4.3 Function Prototyping 79
4.4 Call by Reference 81
4.5 Return by Reference 82
4.6 Inline Functions 82
4.7 DefaultArgUments 84
4.8 constArgUments 87
4.9 Function Overloading 87
4.10 Friend and Virtual Functions 89
4.11 Math Library Functions 90
Summary 90
Review Questions 92
Debugging Exercises 93
Programming Exercises 95
5.1 Introduction 96
5.2 C Structures Revisited 97
5.3 Specifying a Class 99
Contents Vii
5.4 Defining Member Functions 103
5.5 A C++ Program with Class 104
5.6 Making an Outside Function inline 106
5.7 Nesting of Member Functions 107
5.8 PriVate Member Functions 108
5.9 AITays within a Class 109
5.10 Memory Allocation for Objects 114
5.11 Static Data Members 115
5.12 Static Member Functions 117
5.13 Arrays of objects 119
5.14 Objects as Function Arguments 122
5.15 Friendly Functions 124
5.16 Returning Objects 130
5.17 const Member Functions 132
5.18 Pointers to Members 132
5.19 Local Classes 134
Summary 135
Review Questions 136
Debugging Exercises 137
Programming Exercises 142
6.1 Introduction 144
6.2 Constructors 145
6.3 Parameterized Constructors 146
6.4 Multiple Constructors in a Class 150
6.5 Constructors with Default arguments 153
6.6 Dynamic initialization of objects 153
6.7 Copy Constructor 156
6.8 Dynamic Constructors 158
6.9 Constructing Two-dimensional AITays 160
6.10 const Objects 162
6.11 Destructors 162
Summary 164
Review Questions 165
Debugging Exercises 166
Programming Exercises 169
7.1 Introduction 171
7.2 Defining Operator Overloading 172
7.3 Overloading Unary Operators 173
7.4 Overloading Binary Operators 176
Vin Contents
7.5 Overloading Binary Operators Using Friends 179
7.6 Manipulation of Strings Using Operators 183
7.7 Rules for Overloading Operators 186
7.8 Type Conversions 187
Summary 195
Review Questions 196
Debugging Exercises 197
Programming Exercises 200
8.1 Introduction 201
8.2 Defining Derived Classes 202
8.3 Single inheritance 204
8.4 Making a Private Member inheritable 210
8.5 Multilevel inheritance 213
8.6 Multiple inheritance 218
8.7 Hierarchical inheritance 224
8.8 Hybrid inheritance 225
8.9 Virtual Base Classes 228
8.10 Abstract Classes 232
8.11 Constructors in Derived Classes 232
8.12 Member Classes: Nesting of Classes 240
Summary 241
Review Questions 243
Debugging Exercises 243
Programming Exercises 248
9.1 Introduction 251
9.2 Pointers 253
9.3 Pointers to Objects 265
9.4 this Pointer 270
9.5 Pointers to Derived Classes 273
9.6 VirtualFunctions 275
9.7 Pure Virtual Functions 281
Summary 282
Review Questions 283
Debugging Exercises 284
Programming Exercises 289
10.1 Introduction 290
10.2 C++ Streams 291
Contents iX
10.3 C++ Stream Classes 292
10.4 Unformatted I/O Operations 292
10.5 Formatted Console I/O Operations 301
10.6 Managing Output with Manipulators 312
Summary 317
Review Questions 319
Debugging Exercises 320
Programming Exercises 321
11.1 Introduction 323
11.2 Classes for File Stream Operations 325
11.3 Opening and Closing a File 325
11.4 Detecting end-of-file 334
11.5 More about Openo: File Modes 334
11.6 File Pointers and Their Manipulations 335
11.7 Sequential input and Output Operations 338
11.8 Updating a File: Random Acess 343
11.9 Error Handling During File Operations 348
11.10 Command-line ArgUments 350
Summary 353
Review Questions 355
Debugging Exercises 356
Programming Exercises 358
12.1 Introduction 359
12.2 ClassTemplates 360
12.3 Class Templates with Multiple Parameters 365
12.4 FunctionTemplates 366
12.5 Function Templates with Multiple Parameters 371
12.6 Overloading of Template Functions 372
12.7 Member Function Templates 373
12.8 Non-Type Template ArgUments 374
Summary 375
Review Questions 376
Debugging Exercises 377
Programming Exercises 379
13.1 Introduction 380
13.2 Basics of Exception Handling 381
X Contents
13.3 Exception Handling Mechanism 381
13.4 ThrowingMechanism 386
13.5 CatchingMechanism 386
13.6 Rethrowing an Exception 391
13.7 SpecifvingExceptions 392
Summary 394
Review Questions 395
Debugging Exercises 396
Programming Exercises 400
14.1 Introduction 401
14.2 Components of STL 402
14.3 Containers 403
14.4 Algorithms 406
14.5 Iterators 408
14.6 APplication of Container Classes 409
14.7 Functionobjects 419
Summary 421
Review Questions 423
Debugging Exercises 424
Programming Exercises 426
15.1 Introduction 428
15.2 Creating (string) Objects 430
15.3 Manipulating String Objects 432
15.4 Relational Operations 433
15.5 StringCharacteristics 434
15.6 Accessing Characters in Strings 436
15.7 Comparing and Swapping 438
Summary 440
Review Questions 441
Debugging Exercises 442
Programming Exercises 445
16.1 Introduction 446
16.2 New Data Types 447
16.3 New Operators 449
16.4 Class Implementation 451
Contents Xi
16.5 Namespace Scope 453
16.6 OperatorKeyWords 459
16.7 New KeyWords 460
16.8 New Headers 461
Summary 461
Review Questions 463
Debugging Exercises 464
Programming Exercises 467
17.1 Introduction 468
17.2 Procedure-Oriented Paradigms 469
17.3 Procedure-Oriented Development Tools 472
17.4 Object-Oriented Paradigm 473
17.5 Object-Oriented Notations and Graphs 475
17.6 Steps in Object-Oriented Analysis 479
17.7 Steps in Object-Oriented Design 483
17.8 Implementation 490
17.9 Prototypingparadign 490
7.10 WrappingUp 491
Summary 492
Review Questions 494
APpcndln A: Proj'ects 496
APpcndln B: EMcuting Turbo C+ + 539
APpcndln C: executing C+ + Under Windows 552
APpcndln D: Glossary of ANSI C+ + Keywords 564
APpcndln E: C+ + OPeratorprCcedence 57O
APpcndln F: POints to Remember 572
APpcndln G: Glossary of important C+ + and OOP Terms 584
APpcndln H: C+ + Proficiency Test 596
BibIiosrarox aam

相關詞條

熱門詞條

聯絡我們