CSCI 103L Lecture Notes - Lecture 9: Entry Point
Document Summary
*p + 1 : takes what p is pointing to and adds 1: array names and pointers are interchangeable, array indexing and pointer arithmetic are related. Pointer syntax: *(data + i: data is a pointer to the beginning of the array, both of these say the same thing, can also use a pointer as if it were an array, int* ptr = data; Ptr[1] = ptr[2] + ptr[3: can use any pointer like an array. Passing arrays as arguments: can pass the formal parameter by using int my_array[] or int *my_array to indicate an array is being passed. Pass by value: passing a copy of the value, not the actual variable, void decrement(int x) Char** is a pointer to a pointer to a char. Pointer to a pointer to a double. Arrays of pointers: we often want to have several arrays to store data. Store several text strings: those arrays may be related.