Term
Why does C let you access memory that is out of the bounds of an array? |
|
Definition
|
|
Term
Create a list of 10 integers initialized to 0 |
|
Definition
|
|
Term
What happens when you retrieve the value of int list[5]? |
|
Definition
Moves to the list term times the data type size (in this case, 5 * 4 = 20 bytes down) |
|
|
Term
How to tell how many elements there are in an array |
|
Definition
sizeof(array) / sizeof(array[0]) |
|
|
Term
What does *(list + 5) mean, and how does it work? |
|
Definition
It is the value of the sixth element in the array. You locate the start of the array, move 5 * 4 = 20 bytes down (for an integer array), and dereference the pointer at that location. |
|
|
Term
What is pointer arithmetic? |
|
Definition
Finding a pointer that is located (number of elements) * (data type size) bytes down |
|
|