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


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


Unix Topics

Input/Output redirection and pipes

tar utility and compression with gzip

diff and grep

ps and kill commands

  • ps allows lookup of running processes on system
    • -e flag -- show every process
    • -f flag -- full format listing (showing process IDs)
  • kill command -- allows the force shutdown of a running process
    • Apply to process ID number
  • Know how to look up your own running processes on a unix system, and then how to "kill" a process that is "stuck"