Table of contents for Brief version of Starting out with C++ : from control structures through objects / Tony Gaddis, Barret Krupnow.

Bibliographic record and links to related information available from the Library of Congress catalog.

Note: Contents data are machine generated based on pre-publication provided by the publisher. Contents may have variations from the printed book or be incomplete or contain other coding.


Counter
Contents at a Glance
Preface xiii
CHAPTER 1 Introduction to Computers and Programming 1 CHAPTER 2 Introduction to C++ 27
CHAPTER 3 Expressions and Interactivity 77 CHAPTER 4 Making Decisions 157
CHAPTER 5 Looping 239
CHAPTER 6 Functions 291
CHAPTER 7 Arrays 365
CHAPTER 8 Pointers 441
CHAPTER 9 Characters, Strings, and the string Class 489 CHAPTER 10 Structured Data 537
CHAPTER 11 Advanced File Operations 597 CHAPTER 12 Introduction to Classes 651 CHAPTER 13 More About Classes 745 CHAPTER 14 Inheritance, Polymorphism, and Virtual Functions 815
Appendix A: The ASCII Character Set 889
Appendix B: Operator Precedence and Associativity 893
Index 895
Student CD The following chapter and appendices are on the accompanying Student CD.
Chapter B (Bonus Chapter): Searching and Sorting Arrays B-1 Appendix C: Introduction to Flowcharting Appendix D: Using UML in Class Design
Appendix E: Namespaces
Appendix F: Writing Managed C++ Code for the .NET Framework
vi Contents at a Glance
Appendix G: Passing Command Line Arguments
Appendix H: Header File and Library Function Reference Appendix I: Binary Numbers and Bitwise Operations Appendix J: Multi-Source File Programs Appendix K: Stream Member Functions for Formatting Appendix L: Installing and Using Borland C++ Builder 6 Appendix M: Introduction to Microsoft Visual C++ 2005 Express Edition Appendix N: Answers to Checkpoints
Appendix O: Answers to Odd-Numbered Review Questions
Contents
Preface xiii
CHAPTER 1 Introduction to Computers and Programming 1
1.1 Why Program? 1
1.2 Computer Systems: Hardware and Software 2
1.3 Programs and Programming Languages 6
1.4 What Is a Program Made of? 12
1.5 Input, Processing, and Output 16
1.6 The Programming Process 17
1.7 Procedural and Object-Oriented Programming 21
CHAPTER 2 Introduction to C++ 27
2.1 The Parts of a C++ Program 27
2.2 The cout Object 31
2.3 The #include Directive 35
2.4 Variables and Literals 37
2.5 Identifiers 40
2.6 Integer Data Types 42
2.7 The char Data Type 46
2.8 Floating-Point Data Types 51
2.9 The bool Data Type 55
2.10 Determining the Size of a Data Type 56
2.11 Variable Assignments and Initialization 57
2.12 Scope 58
2.13 Arithmetic Operators 59
2.14 Comments 63
2.15 Focus on Software Engineering: Programming Style 65
2.16 If You Plan to Continue in Computer Science: Standard and Prestandard C++ 67
CHAPTER 3 Expressions and Interactivity 77
3.1 The cin Object 77
3.2 Mathematical Expressions 85
3.3 When You Mix Apples and Oranges: Type Conversion 93
3.4 Overflow and Underflow 95
3.5 Type Casting 96
3.6 Named Constants 100
3.7 Multiple Assignment and Combined Assignment 105
3.8 Formatting Output 109
3.9 Formatted Input 119
3.10 Focus on Object-Oriented Programming: More About Member Functions 124
3.11 More Mathematical Library Functions 124
3.12 Focus on Debugging: Hand Tracing a Program 128
3.13 Focus on Problem Solving: A Case Study 130
3.14 Introduction to File Input and Output 134
CHAPTER 4 Making Decisions 157
4.1 Relational Operators 157
4.2 The if Statement 162
4.3 Flags 170
4.4 Expanding the if Statement 171
4.5 The if/else Statement 175
4.6 The if/else if Statement 178
4.7 Using a Trailing else 183
4.8 Menus 184
4.9 Focus on Software Engineering: Nested if Statements 186
4.10 Logical Operators 192
4.11 Checking Numeric Ranges with Logical Operators 198
4.12 Focus on Software Engineering: Validating User Input 200
4.13 More About Variable Definitions and Scope 202
4.14 Comparing Strings 206
4.15 The Conditional Operator 211
4.16 The switch Statement 215
4.17 Testing for File Open Errors 224
CHAPTER 5 Looping 239
5.1 The Increment and Decrement Operators 239
5.2 Introduction to Loops: The while Loop 244
5.3 Using the while Loop for Input Validation 249
5.4 Counters 252
5.5 The do-while Loop 253
5.6 The for Loop 258
5.7 Keeping a Running Total 267
5.8 Sentinels 268
5.9 Using a Loop to Read Data from a File 270
5.10 Focus on Software Engineering: Deciding Which Loop to Use 273
5.11 Nested Loops 273
5.12 Breaking Out of a Loop 276
5.13 The continue Statement 278
CHAPTER 6 Functions 291
6.1 Focus on Software Engineering: Modular Programming 291
6.2 Defining and Calling Functions 293
6.3 Function Prototypes 301
6.4 Sending Data into a Function 303
6.5 Passing Data by Value 308
6.6 Focus on Software Engineering: Using Functions in a Menu-Driven Program 310
6.7 The return Statement 314
6.8 Returning a Value from a Function 316
6.9 Returning a Boolean Value 322
6.10 Local and Global Variables 324
6.11 Static Local Variables 331
6.12 Default Arguments 335
6.13 Using Reference Variables as Parameters 339
6.14 Overloading Functions 344
6.15 The exit() Function 349
6.16 Stubs and Drivers 351
CHAPTER 7 Arrays 365
7.1 Arrays Hold Multiple Values 365
7.2 Accessing Array Elements 367
7.3 No Bounds Checking in C++ 374
7.4 Array Initialization 377
7.5 Processing Array Contents 382
7.6 Focus on Software Engineering: Using Parallel Arrays 390
7.7 Arrays as Function Arguments 393
7.8 Two-Dimensional Arrays 403
7.9 Arrays of Strings 410
7.10 Arrays with Three or More Dimensions 412
7.11 Focus on Problem Solving and Program Design: A Case Study 414
7.12 If You Plan to Continue in Computer Science: Introduction to the STL vector 416
CHAPTER 8 Pointers 441
8.1 Getting the Address of a Variable 441
8.2 Pointer Variables 443
8.3 The Relationship Between Arrays and Pointers 450
8.4 Pointer Arithmetic 454
8.5 Initializing Pointers 456
8.6 Comparing Pointers 457
8.7 Pointers as Function Parameters 459
8.8 Focus on Software Engineering: Dynamic Memory Allocation 468
8.9 Focus on Software Engineering: Returning Pointers from Functions 472
8.10 Focus on Problem Solving and Program Design: A Case Study 476
CHAPTER 9 Characters, Strings, and the string Class 489
9.1 Character Testing 489
9.2 Character Case Conversion 493
9.3 Review of the Internal Storage of C-Strings 496
9.4 Library Functions for Working with C-Strings 499
9.5 String/Numeric Conversion Functions 507
9.6 Focus on Software Engineering: Writing Your Own
C-String-Handling Functions 512
9.7 The C++ string Class 518
9.8 Focus on Problem Solving and Program Design: A Case Study 528
CHAPTER 10 Structured Data 537
10.1 Abstract Data Types 537
10.2 Focus on Software Engineering:
Combining Data into Structures 539
10.3 Accessing Structure Members 542
10.4 Initializing a Structure 547
10.5 Arrays of Structures 551
10.6 Focus on Software Engineering: Nested Structures 554
10.7 Structures as Function Arguments 558
10.8 Returning a Structure from a Function 561
10.9 Pointers to Structures 564
10.10 Focus on Software Engineering: When to Use ., When to Use ->, and When to Use * 567
10.11 Unions 569
10.12 Enumerated Data Types 573
CHAPTER 11 Advanced File Operations 597
11.1 File Operations 597
11.2 File Output Formatting 604
11.3 Passing File Stream Objects to Functions 607
11.4 More Detailed Error Testing 609
11.5 Member Functions for Reading and Writing Files 612
11.6 Focus on Software Engineering: Working with Multiple Files 619
11.7 Binary Files 620
11.8 Creating Records with Structures 626
11.9 Random-Access Files 630
11.10 Opening a File for Both Input and Output 638
CHAPTER 12 Introduction to Classes 651
12.1 Procedural and Object-Oriented Programming 651
12.2 Introduction to Classes 658
12.3 Defining an Instance of a Class 663
12.4 Why Have Private Members? 674
12.5 Focus on Software Engineering: Separating Class Specification from Implementation 675
12.6 Inline Member Functions 681
12.7 Constructors 684
12.8 Passing Arguments to Constructors 688
12.9 Destructors 696
12.10 Overloading Constructors 700
12.11 Private Member Functions 704
12.12 Arrays of Objects 706
12.13 Focus on Problem Solving and Program Design: An OOP Case Study 710
12.14 Focus on Object-Oriented Programming: Creating an Abstract Array Data Type 717
12.15 Focus on Object-Oriented Design: The Unified Modeling Language (UML) 721
12.16 Focus on Object-Oriented Design: Finding the Classes and Their Responsibilities 724
CHAPTER 13 More About Classes 745
13.1 Instance and Static Members 745
13.2 Friends of Classes 753
13.3 Memberwise Assignment 758
13.4 Copy Constructors 759
13.5 Operator Overloading 763
13.6 Object Conversion 790
13.7 Aggregation 792
13.8 Focus on Object-Oriented Design: Class Collaborations 798
CHAPTER 14 Inheritance, Polymorphism, and Virtual Functions 815
14.1 What Is Inheritance? 815
14.2 Protected Members and Class Access 824
14.3 Constructors and Destructors in Base and Derived Classes 830
14.4 Redefining Base Class Functions 837
14.5 Class Hierarchies 841
14.6 Polymorphism and Virtual Member Functions 847
14.7 Abstract Base Classes and Pure Virtual Functions 862
14.8 Multiple Inheritance 869
Appendix A: The ASCII Character Set 889
Appendix B: Operator Precedence and Associativity 893 Index 895
Student CD The following chapters and appendices are on the accompanying Student CD.
CHAPTER B (Bonus Chapter): Searching and Sorting Arrays B-1
B-1 Focus on Software Engineering: Introduction to Search Algorithms B-1 B-2 Focus on Problem Solving and Program Design: A Case Study B-8 B-3 Focus on Software Engineering: Introduction to Sorting Algorithms B-14 B-4 Focus on Problem Solving and Program Design: A Case Study B-22 B-5 If You Plan to Continue in Computer Science: Sorting and 
Searching vectors B-30
Appendix C: Introduction to Flowcharting Appendix D: Using UML in Class Design Appendix E: Namespaces
Appendix F: Writing Managed C++ Code for the .NET Framework Appendix G: Passing Command Line Arguments Appendix H: Header File and Library Function Reference Appendix I: Binary Numbers and Bitwise Operations Appendix J: Multi-Source File Programs
Appendix K: Stream Member Functions for Formatting
Appendix L: Installing and Using Borland C++ Builder 6 Appendix M: Introduction to Microsoft Visual C++ 2005 Express Edition Appendix N: Answers to Checkpoints Appendix O: Answers to Odd-Numbered Review Questions

Library of Congress Subject Headings for this publication:

C++ (Computer program language).