COMP 1125: Principles of Programming - Arrays

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/11

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards covering array terminology, memory layout, declaration syntax, indexing, iteration methods, and key behaviors in C++ based on COMP 1125: Principles of Programming.

12 Terms

1
New cards

Array

A single data structure that holds multiple different values of a specified data type, storing them as a sequence contiguously in memory.

2
New cards

Element

Each individual value contained within an array.

3
New cards

Size (or Length)

The number of elements an array can hold, which cannot be changed after the array is declared.

4
New cards

Index

A numerical position corresponding to an element of an array, used to access or reassign its value.

5
New cards

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.

6
New cards

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.

7
New cards

Subscripts (Indexing)

Bracket notation applied to an array variable to access or reassign values stored at a specific element location.

8
New cards

Zero-Indexed

The indexing scheme used by arrays where the first element is located at index 0 rather than index 1.

9
New cards

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.

10
New cards

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.

11
New cards

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.

12
New cards

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.