Shared Flashcard Set

Details

Systems Terms: Arrays
Terms from Lecture 7 of my Systems class
6
Computer Science
Graduate
02/13/2025

Additional Computer Science Flashcards

 


 

Cards

Term
Why does C let you access memory that is out of the bounds of an array?
Definition
Speed. Checks take time.
Term
Create a list of 10 integers initialized to 0
Definition
int list[10] = {0}
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
Supporting users have an ad free experience!