C and C++ Variables, Memory Management, and Input/Output

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

1/27

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards covering C/C++ memory segments, variable declarations, primitive types, alignment rules, and console I/O stream mechanisms.

Last updated 1:00 AM on 10/15/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

28 Terms

1
New cards

Static RAM

The segment of memory that exists for the entire lifetime of the program and whose total size requirement is calculated at compile time.

2
New cards

Stack RAM

The segment of memory where local variables, parameters, and function call stack frames are allocated and managed based on program scope.

3
New cards

Heap RAM

The segment of memory used for dynamic allocation that starts with an initial allocation from the memory manager and grows as needed during execution.

4
New cards

Global Scope

A scope for variables accessible throughout the entire program; generally discouraged because it creates tight coupling, invites variable overshadowing, and propagates errors.

5
New cards

Local Scope

The scope created as part of a function, placing local variables and parameters inside a stack frame allocated in stack memory.

6
New cards

Block Scope

A subscope created inside control flow structures like for loops or if statements where variables exist only within that specific block and typically overshadow outer variables.

7
New cards

Uninitialized Variable (C/C++)

A declared variable given no initial value that retains whatever leftover bits or arbitrary data happen to be residing in that memory location.

8
New cards

C Basic Data Types

The five primitive data types supported in standard C: character (11 byte), integer (typically 44 bytes), float (typically 44 bytes), double (88 bytes), and void (valueless).

9
New cards

C-Style String

A semantic array of characters that explicitly terminates with a null character (\0\backslash 0) rather than existing as a primitive data type.

10
New cards

Null Character (\0\backslash 0)

A sentinel character that marks the end of a C-style string, requiring string character arrays to be allocated with at least one extra byte of space.

11
New cards

Truthiness in C

The evaluation of truth values in C where exactly 00 represents false and any non-zero value is treated as true.

12
New cards

Data Alignment / Addressing Rules

The hardware requirement where data types must be aligned in memory at address multiples matching their byte size (e.g., 88-byte doubles on multiples of 88, 44-byte ints on multiples of 44).

13
New cards

Short Modifier

A type qualifier that reduces the size of a standard integer from 44 bytes to 22 bytes.

14
New cards

Long Modifier

A type qualifier that increases the size of a standard integer from 44 bytes to 88 bytes.

15
New cards

Unsigned Modifier

A type modifier that forces an integral type to represent only non-negative values rather than the language default of signed values.

16
New cards

Ampersand Prefix Operator (&\&)

An operator prefixed to a variable meaning 'address of' or 'reference to', used to pass a variable's memory address to functions like scanf.

17
New cards

Pass by Pointer

A technique in C where a pointer holding the target address is passed by value, enabling the receiving function to dereference that address and alter the original memory.

18
New cards

iostream

The standard C++ header library that provides classes and operators for object-oriented console input and output streams.

19
New cards

Scope Resolution Operator (::::)

The double-colon operator used in C++ to explicitly specify and access members belonging to a particular namespace, such as std::cout.

20
New cards

Insertion Operator (<<<<)

The double less-than operator used with output streams like cout to push data and variables into the stream buffer.

21
New cards

endl

A C++ stream manipulator that inserts a newline character into the output stream and immediately forces the stream to flush its buffer.

22
New cards

iomanip

The C++ header library containing formatting manipulators like setw and setprecision to format stream output similarly to printf.

23
New cards

setw

A stream manipulator from iomanip that establishes the minimum field width for only the immediately following item inserted into the output stream.

24
New cards

Extraction Operator (>>>>)

The double greater-than operator used with cin to parse input characters from standard input into a variable using whitespace delimiters.

25
New cards

cin.clear()

A member function on cin that resets error state flags (such as the fail flag) so the input stream can resume accepting input.

26
New cards

cin.ignore()

A member function on cin used to discard a specified number of characters from the input stream or skip characters until a designated delimiter character is reached.

27
New cards

cin.get()

A member function on cin that reads and extracts a single character from the input stream, including whitespace characters.

28
New cards

Double Pointer

A pointer variable that stores the memory address of another pointer, utilized in C functions like getline to allow dynamic memory allocation across function boundaries.