What does a pointer store?
A pointer is an object that stores an address, allowing indirect access to another object or function.
Study 7 Pointers and Dynamic Memory with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What does a pointer store?
A pointer is an object that stores an address, allowing indirect access to another object or function.
What does the `&` operator produce?
The address-of operator `&` produces a pointer to an object, such as `int* address = &score;`.
What does unary `*` do to a pointer?
The unary `*` operator dereferences a pointer, accessing its target. It can read the target or modify it when the pointer permits modification.
When is pointer dereferencing valid?
Dereferencing is valid only when the pointer points to a live object or function. Null, dangling, uninitialized, and otherwise invalid pointers must not be dereferenced.
How does pointer arithmetic scale movement?
Within an array, `p + 1` advances to the next element, not necessarily the next byte. The step is scaled by the pointed-to type.
Where is array pointer arithmetic defined?
Pointer arithmetic is defined within one array, including the position one past its end. A one-past pointer may be formed but must not be dereferenced.
What does subtracting same-array pointers produce?
Subtracting two pointers into the same array gives the number of elements between them, such as `&numbers[4] - &numbers[0]`, which equals 4.
What does an array name usually convert to?
In most expressions, an array name converts to a pointer to its first element, so `values` is equivalent to `&values[0]` in that context.
How do arrays and pointers differ?
An array owns a fixed number of elements and includes its size in its type; a pointer only stores an address and does not remember the element count.
What does `nullptr` represent?
`nullptr` represents a pointer that points to no object or function. It may be compared, copied, or assigned, but it must not be dereferenced.
What is a dangling pointer?
A dangling pointer refers to an object whose lifetime has ended. Returning the address of a local variable creates this problem after the function returns.
Which deletion matches `new` and `new[]`?
A single object allocated with `new` must be released with `delete`; an array allocated with `new[]` must be released with `delete[]`.
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.