CSCI 103L Lecture Notes - Lecture 9: Entry Point

37 views3 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents