Discussion Outline
Session 9
Current material
- Pointers to Pointers
- Passing pointers to functions for modification
requires passing pointers to pointers.
- Example:
int GetSpaceForArray (int ** valuesPtr, int num);
where the function takes the address of the int* values that was
declared in main and num is the number of integers to be held in
the space to be allocated. The function would return a positive
integer to indicate success of malloc or a negative value to
indicate the failure of the memory allocation. (Out of Memory).
- Arrays of Pointers
- Typical example array of strings.
- Command line arguments
- Characters - ctype library
Administrative
- Return of Midterm exams - go over the answers
- Discussion of Project 3