Pointers, Arrays, and Dynamic Memory Allocation in C++

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/11

flashcard set

Earn XP

Description and Tags

Flashcards on Pointers, Arrays, and Dynamic Memory Allocation in C++

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

12 Terms

1
New cards

Array

Stores elements in contiguous memory locations; the array name acts as a pointer to the first element.

2
New cards

Array Name

The name of the array acts as a constant pointer to the first element.

3
New cards

Accessing Array Elements with Pointers

Access array elements using pointer arithmetic, e.g., *(ptr + i).

4
New cards

Pointer out-of-bounds access

Accessing memory outside the bounds of the allocated array.

5
New cards

Dynamic Memory

Memory allocated during runtime, providing flexibility for unknown sizes; requires manual management.

6
New cards

Static Memory

Memory allocated at compile time with fixed size.

7
New cards

new operator

Allocates memory at runtime; size can be determined at runtime.

8
New cards

delete operator

Deallocates memory, preventing memory leaks.

9
New cards

Memory Leaks

Allocating memory with 'new' but not deallocating it with 'delete', leading to memory accumulation.

10
New cards

Dangling Pointers

Accessing memory after it has been freed, leading to undefined behavior.

11
New cards

Pointers and Arrays Task

Using pointers to find the max and min values in an array.

12
New cards