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
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