C++ Review for Test 2: List of Concepts Covered

Arrays and Classes

Arrays of Objects

Arrays as member data

Card game example and Array Techniques


Dynamic Memory Allocation and Classes

Memory Allocation Categories

Dynamic Allocation, Deallocation

Notation:

Dynamically resizing an array (application example):

  1. dynamically create a new array of the needed size (need another pointer for this)
  2. copy the data from the old array to the new one (use a for-loop)
  3. delete the old dynamic array (keyword delete)
  4. change the pointer so that the new array has the right name

Using DMA inside a class

Phonebook database example - examples of dynamic allocation, dynamic resizing of array, pass by address, destructor
 


Automatics (Copy constructor, assignment operator)

Automatic functions

Every class has these. If not user-provided, a default is built: Important to note:

Copy Constructor

Assignment operator


Strings -- C-strings vs. string objects


Inheritance - The Basics

The Inheritance Relationship

Declaring derived classes:
Format:   class derivedName : public baseName

Protection levels:
- public and private have usual meanings

protected

Constructors: Constructors with parameters: Defining Derived classes:

Multiple inheritance


Inheritance: Virtual Functions and Abstract Classes

Important Pointer Property

Examples of Benefits To the User

Virtual functions:

Abstract Classes polymorphism Example of these concepts found in Employee class example, as well as the Shape example (and others) posted on the notes pages.

Bitwise Operators

Introduction

The Bitwise Operators

Accessing individual bits