Table of Contents
Chapter 1.0 Introduction
1.1 History of C
1.2 Higher Level Languages
1.3 Operating Systems
1.4 Structured Programming and Problem Solving
1.4.1 Problem Analysis and Specification
1.4.2 Algorithm Development
1.4.3 Program Coding
1.4.4 Program Execution and Testing
1.4.5 Software Engineering
Chapter 2.0 Basic Program Structure, Variables, Data Types and Constants
2.1 The C and C++ Programming Languages
2.2 Advantages and Disadvantages of C and C++
2.3 Program Structure and Rules
2.5 C and C++ Compiler
2.6 Variables, Data Types and Constants
2.7 Data Types
2.8 Storage Classes
2.9 Allocated Space for Data Types
2.10 Variable Names
2.11 Constants
2.11.1 const and volatile
Review Questions
Chapter 3.0 Basic Input-Output Statements
3.1 Basic Screen and Keyboard I/O in C
3.2 Formatted Input and Output
3.3 Non-formatted Input and Output
3.4 Predefined Classes in C++
3.5 Manipulators
3.6 Formatted I/O
Review Questions
Programming Exercises
Programming Projects
Chapter 4.0 Operators
4.1 Order of Precedence of Operators
4.2 Operators: Arithmetic
4.3 Typecasting
4.4 sizeof
4.5 Relational
4.6 The Conditional Operator
4.7 Increment and Decrement
4.8 Assignment
4.9 Bitwise Operators
4.10 Bitwise Complement: ~
4.11 Bitwise Shift Operators
4.11.1 Left Shift Operator: <<
4.11.2 Right Shift Operator: >>
4.12 Multiplication and Division thru Shifting Bits
4.13 Precedence and Associativity
4.14 Bitwise AND Operator: &
4.15 Bitwise Inclusive OR Operator: |
4.16 Bitwise Exclusive OR Operator: ^
4.17 Precedence and Associativity
4.18 Sequence Points or comma
Review Questions
Programming Exercises
Chapter 5.0 Making Decisions and Looping
5.1 Program Control
5.2 Switch Statement
5.3 Loops
5.3.1 while
5.3.2 for
5.3.3 do-while
5.3.4 break
5.3.5 continue
5.4 Declarations within Blocks
5.5 Scope Qualifier Operator
5.6 Scope of Identifiers
Review Questions
Programming Exercises
Programming Projects
Chapter 6.0 Functions
6.1 Functions
6.2 Returning Values
6.3 Passing Arguments
6.4 Command Line Arguments
6.5 Default Arguments
6.6 Functions with an Unspecified Number of Parameters
6.7 Inline Functions
6.8 Reference Types as Arguments
6.9 Overloaded Functions
Review Questions
Programming Exercises
Programming Projects
Chapter 7.0 Arrays
7.1 Arrays
7.1.1 Declaring and Initialization
7.1.2 Multi-Dimensional Arrays
7.2 Arrays as Arguments
7.3 Strings
7.3.1 String Functions
Review Questions
Programming Exercises
Programming Projects
Chapter 8.0 Pointers
8.1 What is a pointer?
8.2 Why are pointers used?
8.3 Pointer Operators
8.4 Declaring a Pointer Variable
8.5 Pointers and Passing Arguments
8.6 Pointers Without Functions
8.7 Pointers and Arrays
8.8 Strings Initialized as Pointers
8.9 Arrays of Pointers
8.10 Lvalue and Rvalue
8.11 Pointers to Functions
8.12 Arrays of Pointers to Functions
8.13 Pointers to Pointers
8.14 const, volatile and Pointers
8.15 Pointers and Memory Addresses
8.16 The new and delete Operators
8.17 Allocating Multi-dimensional Arrays
8.18 Pointers to void and Functions That return void
Review Questions
Programming Exercises
Programming Projects
Chapter 9.0 Structures, Unions and Enumerated Types
9.1 Structures
9.2 Declaring structure variables
9.3 Initializing Structures
9.4 Assignment of Structures
9.5 Nested Structures
9.6 Arrays of Structures
9.7 Passing Structures to Functions
9.8 Unions
9.9 Accessing Members of a union
9.10 Anonymous unions in C++
9.11 Bit Fields
9.12 Byte Alignment
9.13 Enumerated Data Types
9.14 Enumerated Types in C++
9.15 Structures as Abstract Data Types
9.16 Constructors and Destructors
9.17 What Is Object-Oriented Programming?
9.18 Procedure-Oriented Programming
9.19 Adding a New Shape
9.20 OOP Terminology
Review Questions
Programming Exercises
Programming Projects
Chapter 10.0 Classes
10.1 Naming and Coding Conventions
10.2 Discovering Classes
10.3 Classes as Objects
10.4 Returning private values with public Functions
10.5 Member Functions
10.5.1 Inline Member Functions
10.5.2 Typical Public Member Functions.
10.5.3 const Member Functions
10.6 Implementing a Class
10.7 Creating Objects on the Fly
10.8 Allocating Objects on the Free Store
10.9 Destroying Objects on the Free Store
10.10 Arrays of Objects on the Free Store
10.11 Handling Errors in Memory Allocation
10.12 Calling Member Functions
10.13 Using static Member Variables
10.14 Static Member Functions
10.15 Using Pointers to Class Members
10.16 Linked List Class
10.17 The this Pointer
10.17.1 this Points to Instance of Class
10.18 friend Functions
Review Questions
Programming Exercises
Programming Projects
Chapter 11.0 Operators as Functions
11.1 Defining an Overload Operator
11.2 Arguments to Operator Functions
11.3 Operators That Can Be Overloaded
11.4 Copying Class Instances
11.5 Overloading the Input and Output Operators
11.5.1 Input Operator
11.5.2 Output Operator
11.6 Templates
11.6.1 Function Templates
11.6.2 Class Templates
11.7 Exceptions
11.7.1 throw
11.7.2 try
11.7.3 catch
11.7.4 Exception Specifications
11.7.5 terminate() and unexpected()
Review Questions
Programming Exercises
Programming Projects
Chapter 12.0 Inheritance and Polymorphism
12.1 Inheritance Can Represent the Is a Relationship
12.2 Deriving CDialog from CWindow
12.2.1 Initialize the Base Class
12.3 Overriding Inherited Member Functions
12.4 Order of Initialization of Classes Under Single Inheritance
12.5 Multiple Inheritance
12.6 Virtual Base Class
12.7 Restrictions on Virtual Base Classes
12.8 Order of Initialization of Classes Under Multiple Inheritance
12.9 Polymorphism
12.10 Function Call Through a Pointer
12.11 Virtual Functions
12.12 Pure Virtual Functions
12.13 Suppressing Virtual Function Calls
12.14 Virtual Destructors
12.15 Calling Virtual Functions in a Base Class Constructor
12.16 Collections and Containers
Review Questions
Programming Exercises
Programming Projects
Chapter 13.0 File Processing
13.1 High Level, Buffered or Stream I/O
13.2 Low Level Unix Like I/O or Un-buffered I/O
13.3.1 Instances of the class ostream
13.3.2 Stream Input
13.4 Writing Manipulators
13.4.1 Manipulator with No Arguments
13.4.2 Manipulator with One Argument
13.4.3 Manipulator with Two Arguments
13.5 File I/O
13.5.1 Controlling the Stream Operating Modes
13.5.2 Positioning in a File
13.5.3 Detecting Errors in File I/O
13.5.4 Detecting the End-of-File
Review Questions
Programming Exercises
Programming Projects
Chapter 14.0 The Preprocessor
14.1 The Preprocessor
14.2 Macro Replacement
14.3 The # Operator
14.4 The ## Operator
14.5 Conditional Inclusion
14.6 Predefined Macros
14.7 File Inclusion
14.8 Other Directives
Review Questions
Programming Exercises