Object Oriented Programming with C++, 2/e (Paperback)

Sourav Sahay

  • 出版商: Oxford University
  • 出版日期: 2012-11-09
  • 售價: $1,000
  • 貴賓價: 9.8$980
  • 語言: 英文
  • 頁數: 512
  • 裝訂: Paperback
  • ISBN: 0198065302
  • ISBN-13: 9780198065302
  • 相關分類: C++ 程式語言

下單後立即進貨 (約5~7天)




* New chapter on data structures containing new and original algorithms, especially an elegant and simple recursive algorithm for inserting nodes into trees. The explanations are elaborate and full of diagrams.
* New sections on explicit constructors, command line arguments, and re-throwing exceptions
* Expanded glossary

Beginning with an explanation of the procedure-oriented programming system, the role played by structures in this system, and the reasons that led to the creation of OOPS, the book provides a systematic discussion of features such as classes, objects, dynamic memory management, constructors, destructors, inheritance, dynamic polymorphism, and operator overloading. The concepts of stream handling, templates (including the Standard Template Library), and exception handling have been covered in detail to provide more control and convenience to programmers.


1. Introduction to C++
1.1 A Review of Structures
1.1.1 The need for structures
1.1.2 Creating a new data type using structures
1.1.3 Using Structures in Application Programs
1.2 Procedure-Oriented Programming Systems
1.3 Object-Oriented Programming Systems
1.4 Comparison of C++ with C
1.5 Console Input/Output in C++
1.5.1 Console output
1.5.2 Console input
1.6 Variables in C++
1.7 Reference Variables in C++
1.8 Function Prototyping
1.9 Function Overloading
1.10 Default Values for Formal Arguments of Functions
1.11 Inline Functions
2. Classes and Objects
2.1 Introduction to Classes and Objects
2.1.1 Private and Public Members
2.1.2 Objects
2.1.3 The Scope resolution Operator
2.1.4 Creating Libraries using the Scope Resolution Operator
2.1.5 Using Classes in Application Programs
2.1.6 The 'this' pointer
2.1.7 Data Abstraction
2.1.8 Explicit Address manipulation
2.1.9 The arrow operator
2.1.10 Calling one member function from another
2.2 Member Functions and Member Data
2.2.1 Overloaded member functions
2.2.2 Default values for formal arguments of member functions
2.2.3 Inline member functions
2.2.4 Constant member functions
2.2.5 Mutable data members
2.2.6 Friends
2.2.7 Static members
2.3 Objects and Functions
2.4 Objects and Arrays
2.4.1 Arrays of Objects
2.4.2 Arrays inside objects
2.5 Namespaces
2.6 Nested/Inner Classes
3. Dynamic Memory Management
3.1 Introduction
3.2 Dynamic Memory Allocation
3.3 Dynamic Memory Deallocation
3.4 The set_new_handler() function
4. Constructors and Destructors
4.1 Constructors
4.1.1 The zero-argument constructor
4.1.2 Parameterized constructors
4.1.3 Explicit constructors
4.1.4 Copy constructor
4.2 Destructors
4.3 The Philosophy of OOPS
5. Inheritance 151
5.1 Introduction to Inheritance
5.1.1 Effects of inheritance
5.1.2 Benefits of inheritance
5.1.3 Inheritance in actual practice
5.1.4 Base class and derived class objects
5.1.5 Accessing members of the base class in the derived class
5.2 Base Class and Derived Class Pointers
5.3 Function Overriding
5.4 Base Class Initialization
5.5 The Protected Access Specifier
5.6 Deriving by Different Access Specifiers
5.6.1 Deriving by the 'public' access specifier
5.6.2 Deriving by the 'protected' access specifier
5.6.3 Deriving by the 'private' access specifier
5.7 Different Kinds of Inheritance
5.7.1 Multiple inheritance
5.7.2 Ambiguities in Multiple inheritance
5.7.3 Multi-level inheritance
5.7.4 Hierarchical inheritance
5.7.5 Hybrid inheritance
5.8 Order of Invocation of Constructors and Destructors
6. Virtual Functions and Dynamic Polymorphism
6.1 The Need for Virtual Functions
6.2 Virtual Functions
6.3 The Mechanism of Virtual Functions
6.4 Pure Virtual Functions
6.5 Virtual Destructors and Virtual Constructors
6.5.1 Virtual Destructors
6.5.2 Virtual Constructors
7. Stream and File Handling
7.1 Streams
7.2 The Class Hierarchy for Handling Streams
7.3 Text and Binary Input/Output
7.3.1 Data Storage in memory
7.3.2 Input/output of character data
7.3.3 Input/output of numeric data
7.3.4 A note on opening disk files for I/O
7.4 Text Versus Binary Files
7.5 Text Input/Output
7.5.1 Text output
7.5.2 Text input
7.6 Binary Input/Output
7.6.1 Binary output-The write() function
7.6.2 Binary input-The read() function
7.7 Opening and Closing Files
7.7.1 The open() function
7.7.2 The close() function
7.8 Files as Objects of the fstream Class
7.9 File Pointers
7.9.1 The seekp() function
7.9.2 The tellp() function
7.9.3 The seekg() function
7.9.4 The tellg() function
7.10 Random Access to Files
7.11 Object Input/Output through Member Functions
7.12 Error Handling
7.12.1 The eof() function
7.12.2 The fail() function
7.12.3 The bad() function
7.12.4 The clear() function
7.13 Manipulators
7.13.1 Pre-defined manipulators
7.13.2 User-defined manipulators
7.14 Command line arguments
8. Operator Overloading, Type Conversion, New Style Casts, and RTTI
8.1 Operator Overloading
8.1.1 Overloading operators-The Syntax
8.1.2 Compiler interpretation of operator-overloading functions
8.1.3 Overview of overloading unary and binary operators
8.1.4 Operator overloading
8.1.5 Rules for operator overloading
8.2 Overloading the Various Operators
8.2.1 Overloading the increment and decrement operators (prefix and postfix)
8.2.2 Overloading the unary minus and unary plus operator
8.2.3 Overloading the arithmetic operators
8.2.4 Overloading the relational operators
8.2.5 Overloading the assignment operator
8.2.6 Overloading the insertion and extraction operators
8.2.7 Overloading the new and delete operators
8.2.8 Overloading the subscript operator
8.2.9 Overloading the pointer-to-member (->) operator (smart pointer)
8.3 Type Conversion 338
8.3.1 Basic type to class type
8.3.2 Class type to basic type
8.3.3 Class type to class type
8.4 New Style Casts and the typeid Operator
8.4.1 The dynamic_cast operator
8.4.2 The static_cast operator
8.4.3 The reinterpret_cast operator
8.4.4 The const_cast operator
8.4.5 The typeid operator
9. Data Structures
9.1 Introduction
9.2 Linked Lists
9.3 Stacks
9.4 Queues
9.5 Trees
9.5.1 Binary Trees
9.5.2 Binary Search Trees
10. Templates
10.1 Introduction
10.2 Function Templates
10.3 Class Templates
10.3.1 Nested class templates
10.4 The Standard Template Library (STL)
10.4.1 The list class
10.4.2 The vector class
10.4.3 The pair class
10.4.4 The map class
10.4.5 The set class
10.4.6 The multimap class
10.4.7 The multiset class
11. Exception Handling
11.1 Introduction
11.2 C-Style Handling of Error-generating Code
11.2.1 Terminate the program
11.2.2 Check the parameters before function call
11.2.3 Return a value representing an error
11.3 C++-Style Solution-the try/throw/catch Construct
11.3.1 It is necessary to catch exceptions
11.3.2 Unwinding of the stack
11.3.3 Need to throw class objects
11.3.4 Accessing the thrown object in the catch block
11.3.5 Throwing parameterized objects of a nested exception class
11.3.6 Catching uncaught exceptions
11.3.7 Rethrowing Exceptions
11.4 Limitation of Exception Handling
Appendix A-Case Study
Appendix B-Comparison of C++ with C
Appendix C-Comparison of C++ with Java
Appendix D-Object-Oriented Analysis and Design
Appendix E-Glossary
Appendix F-Self Tests