1/11
Vocabulary flashcards covering array terminology, memory layout, declaration syntax, indexing, iteration methods, and key behaviors in C++ based on COMP 1125: Principles of Programming.
Array
A single data structure that holds multiple different values of a specified data type, storing them as a sequence contiguously in memory.
Element
Each individual value contained within an array.
Size (or Length)
The number of elements an array can hold, which cannot be changed after the array is declared.
Index
A numerical position corresponding to an element of an array, used to access or reassign its value.
Contiguous Memory
The memory storage arrangement where array elements are placed consecutively one after the other, allowing element access via an addition calculation from the first element's address.
Size Declarator
The specification inside the brackets during array declaration (e.g., dataType variableName[size];) that determines capacity; it must be a constant or a literal.
Subscripts (Indexing)
Bracket notation applied to an array variable to access or reassign values stored at a specific element location.
Zero-Indexed
The indexing scheme used by arrays where the first element is located at index 0 rather than index 1.
Range-Based for Loop
A loop construct introduced in C++ 11 (also known as a for-each loop or enhanced for loop) that iterates directly over the values of an array rather than over position indices.
Incomplete Initialization List
An array initializer shorter than the total declared size, which sets the remaining unspecified elements to default values (such as 0 for integers or an empty string for strings) instead of garbage values.
Bound Checking
A safety mechanism that is absent in C++ arrays; attempting to read past the boundary of an array (such as accessing the 4th element of a 3-element array) produces garbage values rather than an error.
Reference Copy (Array Assignment)
Attempting to assign one array directly to another (e.g., array2 = array1), which fails to duplicate elements and instead attempts to reassign the starting memory address.