Cover image for Object-oriented programming with C++
Title:
Object-oriented programming with C++
Personal Author:
Series:
Oxford higher education
Publication Information:
New York : Oxford University Press, 2006
Physical Description:
vii, 473 p. : ill. ; 25 cm.
ISBN:
9780195681529

Available:*

Library
Item Barcode
Call Number
Material Type
Item Category 1
Status
Searching...
30000003494527 QA76.73.C153 S23 2006 Open Access Book Book
Searching...

On Order

Summary

Summary

Designed to serve as a textbook for undergraduate engineering and MCA students, Object-Oriented Programming with C++ imparts a clear understanding of objects and the method of modelling them in OOPS. The book contains a systematic discussion of features such as classes, objects, dynamic memory management, constructors, destructors, inheritance, overloading, polymorphism, stream handling and exception handling.


Author Notes

S. Sahay, Senior Consulting Software Engineer, Blue State Solutions, Albany, New York. He has over eight years of experience in the software industry. His programming experience area includes C, C++, Java, OOAD, Oracle, Visual Basic, Crystal Reports, PegaRules Process Commander, HTML, and JavaScript.
He has taught C and C++ to students of Calcutta University on behalf of CMC Ltd. Besides this, he has conducted a number of training programmes and workshops on various subjects for large corporate houses and prestigious software development firms, such as RS Software, Sema Group, Life Insurance Corporation, All India Radio, and Border Security Forces.


Table of Contents

Prefacep. iii
1 Introduction to C++p. 1
1.1 A Review of Structuresp. 2
1.2 Procedure-Oriented Programming Systemp. 7
1.3 Object-Oriented Programming Systemp. 9
1.4 Comparison of C++ with Cp. 11
1.5 Console Input/Output in C++p. 12
1.6 Variables in C++p. 18
1.7 Reference Variables in C++p. 19
1.8 Function Prototypingp. 25
1.9 Function Overloadingp. 29
1.10 Default Values for Formal Arguments of Functionsp. 31
1.11 Inline Functionsp. 34
2 Classes and Objectsp. 41
2.1 Introduction to Classes and Objectp. 42
2.2 Member Functions and Member Datap. 64
2.3 Objects and Functionsp. 84
2.4 Objects and Arraysp. 87
2.5 Namespacesp. 88
2.6 Nested Classesp. 92
3 Dynamic Memory Managementp. 103
3.1 Introductionp. 104
3.2 Dynamic Memory Allocationp. 105
3.3 Dynamic Memory Deallocationp. 110
3.4 The set_new_handler() functionp. 116
4 Constructors and Destructorsp. 121
4.1 Constructorsp. 122
4.2 Destructorsp. 140
4.3 The Philosophy of OOPSp. 145
5 Inheritancep. 151
5.1 Introduction to Inheritancep. 152
5.2 Base Class and Derived Class Pointersp. 157
5.3 Function Overridingp. 163
5.4 Base Class Initializationp. 166
5.5 The Protected Access Specifierp. 169
5.6 Deriving by Different Access Specifiersp. 170
5.7 Different Kinds of Inheritancep. 177
5.8 Order of Invocation of Constructors and Destructorsp. 187
6 Virtual Functions and Dynamic Polymorphismp. 195
6.1 The Need for Virtual Functionsp. 196
6.2 Virtual Functionp. 220
6.3 The Mechanism of Virtual Functionsp. 205
6.4 Pure virtual Functionsp. 207
6.5 Virtual Destructors and Virtual Constructorsp. 213
7 Stream Handlingp. 221
7.1 Streamsp. 222
7.2 The Class Hierarchy for Handling Streamsp. 222
7.3 Text and Binary Input/Outputp. 224
7.4 Text Versus Binary Filesp. 227
7.5 Text Input/Outputp. 228
7.6 Binary Input/Outputp. 238
7.7 Opening and Closing Filesp. 248
7.8 Files as Objects of the fstream Classp. 250
7.9 File Pointersp. 250
7.10 Random Accesses to Filesp. 253
7.11 Object Input/Output Through Member Functionsp. 254
7.12 Error Handlingp. 255
7.13 Manipulatorsp. 257
8 Operator Overloading, Type Conversion, New Style Casts, and RTTIp. 267
8.1 Operator Overloadingp. 268
8.2 Overloading the Various Operatorsp. 28-
8.3 Type Conversionp. 338
8.4 New Style Casts and the typeid Operatorp. 343
9 Templatesp. 363
9.1 Introductionp. 364
9.2 Function Templatesp. 365
9.3 Class Templatesp. 370
9.4 The Standard Template Library (STL)p. 377
10 Exception Handingp. 393
10.1 Introductionp. 394
10.2 C-Style Handling of Error-generating Codep. 394
10.3 C++-Style Solution-the try/throw/catch Constructp. 399
10.4 Limitation of Exception Handingp. 415
Appendix A Case Studyp. 419
A.1 A Word Query Systemp. 419
Appendix B Comparison of C++ with Cp. 429
Appendix C Comparison of C++ with Javap. 431
C.1 Similarities between C++ and Javap. 431
C.2 Differences between C++ and Javap. 433
Appendix D Object-Oriented Analysis and Designp. 445
D.1 Introductionp. 445
D.2 The Object-Oriented Modelp. 446
D.3 Analysisp. 445
D.4 System Designp. 456
D.5 Object Designp. 457
D.6 Implementationp. 458
Appendix E Glossaryp. 459
Appendix F Self Testsp. 465
Test 1p. 465
Test 2p. 468
Test 3p. 471
Referencesp. 475
Indexp. 477