C++ Review: List of Concepts Covered (since test 2)


<cstring> library functions:


Pointers

Basics

Initializing pointers

If p is a pointer, then how can we fill in the blank?
 p = _____
Four ways:
  1. NULL pointer
  2. Another pointer of the same type
  3. The "address of" an existing variable
  4. a new operation (Dynamic Allocation -- See below)

Pointer Arithmetic:

Pointers and Arrays:

Pass by Address:


Dynamic Memory Allocation

Memory Allocation Categories

Dynamic Allocation, Deallocation

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 original name

Structures

Using structures

Enumerations


C vs. C++

Formatted Output with printf

Formatted Input with scanf

Other C / C++ differences

Understand the other language differences discussed in class, including: