C++面向对象程序设计 : 第4版

C++面向对象程序设计 : 第4版

(印) 巴拉古路萨米 (Balagurusamy,E.) , 著

出版社:清华大学出版社

年代:2009

定价:60.0

书籍简介:

本书以一种简单易懂的写作风格,介绍了何谓C++面向对象程序设计、为什么以及如何用C++进行面向对象程序设计。

书籍目录:

Preface . xiii

1. Principles of Object-Oriented Programming 1

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. Beginning with C++ 19

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. Tokens,Expressions and Control Structures 35

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

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. Function in C++ 77

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. Classes and Objects 96

5.1 Introduction 96

5.2 C Structures Revisited 97

5.3 Specifying a Class 99

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. Constructors and Destructors

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. Operator Overloading and Type Conversions 171

7.1 Introduction 171

7.2 Defining Operator Overloading 172

7.3 Overloading Unary Operators 173

7.4 Overloading Binary Operators 176

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. Inheritance:Extending Classes 201

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. Pointes,Virtual Functions and Polymorphism 251

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. Managing Console I/O Operations 290

10.1 Introduction 290

10.2 C++ Streams 291

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. Working with Files 323

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. Templates 359

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. Exception Handling 380

13.1 Introduction 380

13.2 Basics of Exception Handling 381

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. Introduction to the Standard Template Library 401

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. Manipulating Strings 428

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. New Features of ANSI C++ Standard 446

16.1 Introduction 446

16.2 New Data Types 447

16.3 New Operators 449

16.4 Class Implementation 451

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. Object-Oriented Systems Development 468

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

17.10 WrappingUp 491

Summary 492

Review Questions 494

APpcndln A: Projects 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 570

APpcndln F: POints to Remember 572

APpcndln G: Glossary of important C++ and OOP Terms 584

APpcndln H: C++ Proficiency Test 596

Bibliograpby 632

内容摘要:

《C++面向对象程序设计(第4版)》以一种简单易懂的写作风格,介绍了何谓C++面向对象程序设计、为什么以及如何用C++进行面向对象程序设计。书给出了大量的示例、演示说明以及完整的程序。这些示例程序既简单也很具有教学意义。在必要的时候,《C++面向对象程序设计(第4版)》还使用了概念图,使得介绍更加清晰,便于更好地理解。《C++面向对象程序设计(第4版)》还介绍了面向对象方法的概念,简要讨论了系统的面向对象分析与设计的重要内容。《C++面向对象程序设计(第4版)》的最大亮点是附录A的两个新的程序设计项目:(1)基于菜单的计算系统;(2)银行系统。它们演示了如何在现实应用程序中集成C++的各种特性。 《C++面向对象程序设计(第4版)》不仅可以作为高等院校C++面向对象程序设计的教材,也是希望了解C++语言和面向对象程序设计知识的专业人员的很好参考书。

书籍规格:

书籍详细信息
书名C++面向对象程序设计 : 第4版站内查询相似图书
丛书名大学计算机教育国外著名教材系列
9787302207320
如需购买下载《C++面向对象程序设计 : 第4版》pdf扫描版电子书或查询更多相关信息,请直接复制isbn,搜索即可全网搜索该ISBN
出版地北京出版单位清华大学出版社
版次1版印次1
定价(元)60.0语种英文
尺寸26 × 0装帧平装
页数印数

书籍信息归属:

C++面向对象程序设计 : 第4版是清华大学出版社于2009.出版的中图分类号为 TP312 的主题关于 C语言-程序设计-高等学校-教材-英文 的书籍。