What is a C++ built-in array?
A built-in array is a fixed-size sequence of elements of one type stored in contiguous memory.
Study 06 Arrays with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is a C++ built-in array?
A built-in array is a fixed-size sequence of elements of one type stored in contiguous memory.
What should a range-based loop use to modify array elements?
Use a reference, such as `for (int& value : values)`, when the loop must modify the original elements.
What indices are valid for an array with N elements?
For an array with N elements, valid indices run from 0 through N−1.
What is the general syntax for declaring a one-dimensional array?
The declaration syntax is `type name[size];`. The size specifies how many elements the array contains.
What happens when an initializer has too few values?
The remaining elements are value-initialized; for an integer array, they become 0.
How can C++ deduce a built-in array's size?
The compiler deduces the bound from the number of supplied initializers, so `int primes[] = {2, 3, 5, 7, 11};` creates five elements.
Why does `char word[] = "hello";` contain six characters?
The terminating null character `\0` is included, so `char word[] = "hello";` contains six characters.
What happens when a built-in array is accessed out of bounds?
Accessing an index outside 0 through size−1 produces undefined behavior; C++ does not automatically check built-in array bounds.
How can code compute a local built-in array's element count?
For an array in its original scope, `sizeof(values) / sizeof(values[0])` computes its element count.
Why cast the sum when computing an array average?
Cast the sum to `double` before division, as in `static_cast<double>(sum) / count`, to avoid integer division.
How are indices interpreted in `int matrix[2][3]`?
In `int matrix[2][3]`, the first index selects one of two rows and the second selects one of three columns.
Which index varies fastest during multidimensional initialization?
The rightmost index varies fastest: initialization proceeds through `matrix[0][0]`, `matrix[0][1]`, `matrix[0][2]`, then the second row.
A 14-question medium-difficulty quiz on Boolean algebra, logic gates, truth tables, and combinational circuits.
A focused set of flashcards covering Python variables, data types, expressions, control flow, functions, input, output, and common programming practices.
Learn how Boolean expressions, logical operators, and conditional structures let programs make reliable decisions, including how to handle boundaries, branch order, and testing.
Learn how computer memory stores and addresses information, how RAM and ROM differ, and how caches and the memory hierarchy balance speed, capacity, and cost.
A progressive guide to tree structure, binary-tree traversals, binary search tree operations, deletion, balancing, and the way tree height determines time and space costs.
A practical guide to integrating problem definition, data representation, modular programming, algorithms, complexity analysis, testing, correctness, and ethical evaluation into a responsible computer science capstone.
Reviews how interrupts support event handling and multitasking, and how Linux system calls use the RISC-V `ecall` instruction and register conventions.
This quiz covers process management, context switching and scheduling, multitasking, traps and interrupts, and RISC-V privilege transitions.
A quiz on operating-system system calls, including privileged-operation requests, process creation and execution with fork, exec, and waitpid, and signal handling.