Comprehensive C++ Programming Vocabulary for Chapters 1-4

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

1/53

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 12:48 AM on 4/24/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

54 Terms

1
New cards

Specification

A precise, written description of the problem a program must solve. Often includes sample output or pre/postconditions.

2
New cards

Design

The phase of formulating the steps (algorithm) to solve the problem, often using pseudocode.

3
New cards

Implementation

The actual C++ code that carries out the design.

4
New cards

Pseudocode

A mixture of English and a programming language used to outline an algorithm without worrying about strict language syntax.

5
New cards

Decomposition

Breaking down a large problem into smaller, manageable subtasks (functions).

6
New cards

Precondition

A statement indicating what must be true before a function is called. It is the caller's responsibility.

7
New cards

Postcondition

A statement indicating what will be true when the function finishes its work. It is the function's guarantee.

8
New cards

Procedural Abstraction

A form of information hiding where you know what a function does but not how it is implemented.

9
New cards

`assert()`

A macro (from ``) that tests a condition. If false, it prints an error and halts the program. Used to check preconditions during development.

10
New cards

`NDEBUG`

A preprocessor directive (`#define NDEBUG`) that disables all `assert()` statements for production code.

11
New cards

Big-O Notation

A mathematical notation used to describe the order (time complexity) of an algorithm as the input size ($n$) grows.

12
New cards

Linear Time [O(n)]

Algorithm time grows proportionally to the input size. Example: Looping through an array once.

13
New cards

Quadratic Time [O(n²)]

Algorithm time grows proportionally to the square of the input size. Example: Nested loops.

14
New cards

Logarithmic Time [O(log n)]

Algorithm time grows very slowly as input size increases. Example: Binary Search.

15
New cards

Boundary Values

Test inputs that are 'one step away' from different behavior (e.g., 0, max size, empty string). Most likely to cause errors.

16
New cards

Fully Exercising Code

A testing technique ensuring every line of code is executed at least once by some test case.

17
New cards

Class

A user-defined data type that encapsulates data (member variables) and functions (member functions) to manipulate that data.

18
New cards

Object / Instance

A variable declared of a specific class type.

19
New cards

Member Function

A function defined within the scope of a class. It operates on the data of a specific object.

20
New cards

`const` Member Function

A member function that promises not to modify the object's member variables. Syntax: `void print() const;`

21
New cards

Constructor

A special member function called automatically when an object is created. It has the same name as the class and no return type.

22
New cards

Default Constructor

A constructor that takes no arguments. If you write any constructor, the compiler no longer generates the automatic default constructor.

23
New cards

Inline Function

A function whose definition is placed inside the class definition. It is a hint to the compiler to replace the function call with the actual code body to save overhead.

24
New cards

Namespace

A declarative region that provides a scope to identifiers (names) to prevent naming collisions between libraries.

25
New cards

Macro Guard

`#ifndef` / `#define` / `#endif` directives used in header files to prevent the compiler from seeing the same class definition twice.

26
New cards

Value Semantics

The behavior of copying objects via the assignment operator (`=`) and the copy constructor.

27
New cards

Value Parameter

A parameter where the function receives a copy of the argument. Changes inside the function do not affect the original.

28
New cards

Reference Parameter (`&`)

A parameter where the function receives an alias to the original argument. Changes inside the function do affect the original.

29
New cards

Const Reference (`const &`)

A parameter that is efficient like a reference (no copy) but safe like a value (function cannot modify the original).

30
New cards

Operator Overloading

Giving a standard C++ operator (like `+`, `==`, `<<`) a new meaning for a user-defined class.

31
New cards

Friend Function

A non-member function that has been granted access to the private members of a class. Used often for `operator >>` and `operator <<`.

32
New cards

Container Class

A class designed to hold a collection of items (e.g., `bag`, `sequence`).

33
New cards

`typedef`

A keyword used to create an alias for a data type (e.g., `typedef int value_type;`). This makes it easy to change the underlying data type of the container later.

34
New cards

`std::size_t`

A standard data type defined in ``. It is an unsigned integer guaranteed to be large enough to hold the size of any object in memory.

35
New cards

`static const`

A member variable that is shared by all objects of the class (`static`) and cannot be changed after initialization (`const`). Used for constants like `CAPACITY`.

36
New cards

Partially Filled Array

An array where only the beginning segment holds valid data. The rest is ignored/garbage. Requires a variable (`used`) to track the valid count.

37
New cards

Class Invariant

A set of rules that dictate exactly how the private member variables represent the abstract state of the object. Example: 'The items are stored in `data[0]` through `data[used-1]`.'

38
New cards

Internal Iterator

Functions (`start`, `advance`, `current`) that allow a user to step through the items of a container one at a time, controlled by the object's internal state.

39
New cards

Pointer

A variable that stores the memory address of another variable or dynamic memory location.

40
New cards

Address Operator (`&`)

Returns the memory address of a variable. Example: `&my_var`.

41
New cards

Dereferencing Operator (`*`)

Accesses the value stored at the memory address held by a pointer. Example: `*ptr = 42;`.

42
New cards

`new` Operator

Allocates memory on the heap. Returns a pointer to the newly allocated memory.

43
New cards

`delete` Operator

Releases memory previously allocated with `new` back to the heap. Failure to do this causes a memory leak.

44
New cards

`delete[]` Operator

Releases memory previously allocated for a dynamic array with `new[]`.

45
New cards

Stack Memory

Memory managed automatically by the compiler for local variables and function calls. Fast, but limited size (Stack Overflow risk). Variables die when the function returns.

46
New cards

Heap Memory (Free Store)

Memory managed manually by the programmer (using `new`/`delete`). Larger pool of memory, accessible anywhere until freed.

47
New cards

`bad_alloc`

An exception thrown by the `new` operator if the heap runs out of memory.

48
New cards

Dynamic Array

An array whose size is determined at run time rather than compile time. Created using `new Type[size]`.

49
New cards

`this` Pointer

A keyword that acts as a pointer to the current object inside a member function. Used to disambiguate parameters or return the object itself (`return *this;`).

50
New cards

Destructor (`~ClassName`)

A member function called automatically when an object is destroyed. Critical for releasing dynamic memory held by the object to prevent leaks.

51
New cards

Copy Constructor

A constructor used to create a new object as a deep copy of an existing object. Prototype: `bag(const bag& source);`

52
New cards

Assignment Operator (`operator=`)

A member function used to assign the state of one existing object to another existing object. Must handle self-assignment and release old memory.

53
New cards

Shallow Copy

Copying only the pointer address. Both objects point to the same heap memory (dangerous).

54
New cards

Deep Copy

Allocating new heap memory and copying the actual data pointed to. Both objects have independent copies (safe).