CIS 181 Intro to Comp Sci
Class 13, March 22, 2005

ASSIGNMENT:

Read: D&D, through 348 (section 5.8)

Exercises due Thursday, March 24: finish lab and Assignment 2!


UNIX TIP OF THE DAY:

You can actually run a unix shell from within xemacs. Just type
esc-x shell
and you will get a unix shell. All commands that you would normally execute on the command line you can execute from within this shell. When I run xemacs in this fashion, I normally split the screen into two by doing:
ctrl-x 2
You can edit a file in one window and run a shell in the other.


TODAY'S TOPICS

  1. Go over Recrsive Binary Search (discuss what is actually getting passed to a function when passing an array to a function and how to "fool" C++ into thinking it is getting a full array when it isn't really).
  2. Another recursive function with arrays: recursively printing out a character string in reverse.
  3. Go over homework palindrome.
  4. Discuss lab.
  5. Introduction to pointers.
  6. Addresses, pointers. The operators & (address of) and * (contents of, dereferencing operator). See the file $CLASSHOME/deitel-files/examples/ch05/fig5_4.cpp)
  7. Summary of the two uses of * and &
    * &
    In a declaration comes after the type comes after the type
    declares a pointer declares a ref(alias)
    int *intPtr; must be initialized
    int m; int &aka_m = m;

    As an operator comes before its operand comes before its operand
    dereferences a pointer
    *intPtr
    returns the addr of op
    *(&m) == m