1/9
Practice vocabulary flashcards covering the definition, indexing, out-of-bounds behavior, and size calculation of arrays in the C programming language.
Array
A fixed-size collection of elements of the same data type that can store more than one value.
Element
Each individual value contained within an array.
Pointer Decay
The phenomenon where passing an array to a function (such as printf) causes it to decay into a pointer, producing unexpected output or a long numeric memory address.
Index 0
The index number representing the first element of an array in C, because computers begin indexing at zero.
Out of Bounds
The state of attempting to access an index that does not exist within an array, which in C runs without an exception and produces a garbage value.
Garbage Value
An arbitrary, unexpected value returned in C when attempting to read an array element that is out of bounds.
%c
The format specifier used in printf to display a character value.
Strings in C
Arrays of characters that can be declared with double quotes or as individual character elements.
sizeof Function
A function in C used to determine the size of a variable, array, or data type in bytes of memory.
Array Element Count Formula
A calculation where the total memory size of an array is divided by the size of a single element (such as at index 0) to find the number of elements: sizeof(array[0])sizeof(array).