Developers: Learn a New Programming Language or App Development with Deitel LiveLessons Videos!
s
menu
menu
Login  |  Register  |  Media Kit  |  Press  |  Contact Us  |   Twitter Become a Deitel Fan on Facebook  
Custom Search



 
AddThis Social Bookmark Button

Table of Contents: Small C++ How to Program, 5/e

1Introduction to Computers, the Internet and World Wide Web1
   
1.1Introduction 2
1.2What Is a Computer? 3
1.3Computer Organization 4
1.4Early Operating Systems 5
1.5Personal, Distributed and Client/Server Computing 5
1.6The Internet and the World Wide Web 6
1.7Machine Languages, Assembly Languages and High-Level Languages 6
1.8History of C and C++ 8
1.9C++ Standard Library 8
1.1History of Java 9
1.11FORTRAN, COBOL, Pascal and Ada 10
1.12Basic, Visual Basic, Visual C++, C# and .NET 11
1.13Key Software Trend: Object Technology 11
1.14Typical C++ Development Environment 12
1.15Notes About C++ and Small C++ How to Program, 5/e 15
1.16Test-Driving a C++ Application 16
1.17Introduction to Object Technology and the UML 22
1.18Wrap-Up 27
1.19Web Resources 28
2Introduction to C++ Programming 36
2.1Introduction 37
2.2First Program in C++: Printing a Line of Text 37
2.3Modifying Our First C++ Program 41
2.4Another C++ Program: Adding Integers 42
2.5Memory Concepts 46
2.6Arithmetic 48
2.7Decision Making: Equality and Relational Operators 51
2.8Wrap-Up 56
3Introduction to Classes and Objects 65
3.1Introduction 66
3.2Classes, Objects, Member Functions and Data Members 66
3.3Overview of the Chapter Examples 68
3.4Defining a Class with a Member Function 68
3.5Defining a Member Function with a Parameter 72
3.6Data Members, set Functions and get Functions 75
3.7Initializing Objects with Constructors 82
3.8Placing a Class in a Separate File for Reusability 86
3.9Separating Interface from Implementation 90
3.1Validating Data with set Functions 96
3.11Wrap-Up 101
4Control Statements: Part 1 108
4.1Introduction 109
4.2Algorithms 109
4.3Pseudocode 110
4.4Control Structures 111
4.5if Selection Statement 115
4.6if else Double-Selection Statement 116
4.7while Repetition Statement 121
4.8Formulating Algorithms: Counter-Controlled Repetition 123
4.9Formulating Algorithms: Sentinel-Controlled Repetition 129
4.1Formulating Algorithms: Nested Control Statements 140
4.11Assignment Operators 145
4.12Increment and Decrement Operators 145
4.13Wrap-Up 149
5Control Statements: Part 2 164
5.1Introduction 165
5.2Essentials of Counter-Controlled Repetition 165
5.3for Repetition Statement 167
5.4Examples Using the for Statement 172
5.5do while Repetition Statement 176
5.6switch Multiple-Selection Statement 178
5.7break and continue Statements 188
5.8Logical Operators 190
5.9Confusing Equality (==) and Assignment (=) Operators 195
5.1Structured Programming Summary 196
5.11Wrap-Up 201
6Functions and an Introduction to Recursion 211
6.1Introduction 212
6.2Program Components in C++ 213
6.3Math Library Functions 214
6.4Function Definitions with Multiple Parameters 216
6.5Function Prototypes and Argument Coercion 221
6.6C++ Standard Library Header Files 223
6.7Case Study: Random Number Generation 225
6.8Case Study: Game of Chance and Introducing enum 231
6.9Storage Classes 235
6.1Scope Rules 238
6.11Function Call Stack and Activation Records 241
6.12Functions with Empty Parameter Lists 245
6.13Inline Functions 246
6.14References and Reference Parameters 248
6.15Default Arguments 253
6.16Unary Scope Resolution Operator 255
6.17Function Overloading 256
6.18Function Templates 259
6.19Recursion 261
6.2Example Using Recursion: Fibonacci Series 265
6.21Recursion vs. Iteration 268
6.22Wrap-Up 271
7Arrays and Vectors 292
7.1Introduction 293
7.2Arrays 294
7.3Declaring Arrays 295
7.4Examples Using Arrays 296
7.5Passing Arrays to Functions 312
7.6Case Study: Class GradeBook Using an Array to Store Grades 317
7.7Searching Arrays with Linear Search 324
7.8Sorting Arrays with Insertion Sort 325
7.9Multidimensional Arrays 328
7.1Case Study: Class GradeBook Using a Two-Dimensional Array 331
7.11Introduction to C++ Standard Library Class Template vector 338
7.12Wrap-Up 343
8Pointers and Pointer-Based Strings 360
8.1Introduction 361
8.2Pointer Variable Declarations and Initialization 362
8.3Pointer Operators 363
8.4Passing Arguments to Functions by Reference with Pointers 366
8.5Using const with Pointers 370
8.6Selection Sort Using Pass-by-Reference 377
8.7sizeof Operators 380
8.8Pointer Expressions and Pointer Arithmetic 383
8.9Relationship Between Pointers and Arrays 386
8.1Arrays of Pointers 390
8.11Case Study: Card Shuffling and Dealing Simulation 391
8.12Function Pointers 397
8.13Introduction to Pointer-Based String Processing 402
8.14Wrap-Up 413
9Classes: A Deeper Look, Part 1 439
9.1Introduction 440
9.2Time Class Case Study 441
9.3Class Scope and Accessing Class Members 446
9.4Separating Interface from Implementation 448
9.5Access Functions and Utility Functions 450
9.6Time Class Case Study: Constructors with Default Arguments 452
9.7Destructors 458
9.8When Constructors and Destructors Are Called 459
9.9Time Class Case Study: Subtle Trap—Returning a Reference to a private Data Member 462
9.1Default Memberwise Assignment 465
9.11Software Reusability 467
9.12Wrap-Up 468
10Classes: A Deeper Look, Part 2 474
10.1Introduction 475
10.2const (Constant) Objects and const Member Functions 475
10.3Composition: Objects as Members of Classes 485
10.4friend Functions and friend Classes 492
10.5Using the this Pointer 496
10.6Dynamic Memory Management with Operators new and delete 501
10.7static Class Members 503
10.8Data Abstraction and Information Hiding 509
10.9Container Classes and Iterators 512
10.1Proxy Classes 513
10.11Wrap-Up 516
11Operator Overloading; String and Array Objects 522
11.1Introduction 523
11.2Fundamentals of Operator Overloading 524
11.3Restrictions on Operator Overloading 525
11.4Operator Functions as Class Members vs. Global Functions 527
11.5Overloading Stream Insertion and Stream Extraction Operators 528
11.6Overloading Unary Operators 532
11.7Overloading Binary Operators 532
11.8Case Study: Array Class 533
11.9Converting between Types 545
11.1Case Study: String Class 546
11.11Overloading ++ and -- 558
11.12Case Study: A Date Class 560
11.13Standard Library Class string 564
11.14explicit Constructors 568
11.15Wrap-Up 572
12Object-Oriented Programming: Inheritance 584
12.1Introduction 585
12.2Base Classes and Derived Classes 586
12.3protected Members 589
12.4Relationship between Base Classes and Derived Classes 589
12.5Constructors and Destructors in Derived Classes 621
12.6public, protected and private Inheritance 629
12.7Software Engineering with Inheritance 629
12.8Wrap-Up 631
13Object-Oriented Programming: Polymorphism 637
13.1Introduction 638
13.2Polymorphism Examples 640
13.3Relationships Among Objects in an Inheritance Hierarchy 641
13.4Type Fields and switch Statements 658
13.5Abstract Classes and Pure virtual Functions 659
13.6Case Study: Payroll System Using Polymorphism 661
13.7(Optional) Polymorphism, Virtual Function and Dynamic Binding “Under the Hood” 679
13.8Case Study: Payroll System Using Polymorphism and Run-Time Type Information with Downcasting, dynamic_cast, typeid and type_info 683
13.9Virtual Destructors 686
13.1Wrap-Up 687
A Operator Precedence and Associativity Chart 692
A.1Operator Precedence 692
B ASCII Character Set 695
C Fundamental Types 696
D Number Systems 698
D.1Introduction 699
D.2Abbreviating Binary Numbers as Octal and Hexadecimal Numbers 702
D.3Converting Octal and Hexadecimal Numbers to Bi­nary Numbers 703
D.4Converting from Binary, Octal or Hexadecimal to Decimal 703
D.5Converting from Decimal to Binary, Octal or Hexadecimal 704
D.6Negative Binary Numbers: Two’s Complement Notation 706
E C++ Internet and Web Resources 711
E.1Resources 711
E.2Tutorials 713
E.3FAQs 713
E.4Visual C++ 713
E.5Newsgroups 714
E.6Compilers and Development Tools 714
F Using the Visual Studio  .NET Debugger 715
F.1Introduction 716
F.2Breakpoints and the Continue Command 716
F.3The Locals and Watch Windows 722
F.4Controlling Execution Using the Step Into, Step Over, Step Out and Continue Commands 725
F.5The Autos Window 728
F.6Wrap-Up 729
G Using the GNU  C++ Debugger 732
G.1Introduction 733
G.2Breakpoints and the run, stop, continue and print Commands 733
G.3The print and set Commands 740
G.4Controlling Execution Using the step, finish and next Commands 742
G.5The watch Command 744
G.6Wrap-Up 747
Bibliography750
Index 752
 1

© 1992-2005. Deitel & Associates, Inc. All Rights Reserved.  

 

Deitel Dive-Into(R) Series Corporate Training

Discounts on SafariBooksOnline.com subscriptions

 
Small C How to Program, 5/e Cover


ISBN: 0131857584
© 2005, pp. 835

Order now at
Amazon.com
InformIT.com

Download Code
Examples and
Other Premium
Content for
Registered Users

Login or Register to download this book's code examples and other premium content.

foot
Update :: October 01, 2014