Skip to content

Terms

Whether you are new to programming or just to C++, you will meet a lot of unfamiliar words. This page gives a short, plain definition of the ones used in this book, with a pointer to where each is explained in full. It is alphabetical — use the search box at the top to jump straight to a term.

Term Meaning
abstract class A class with at least one pure virtual function (= 0); it cannot be created directly, only inherited from. See Polymorphism.
argument A value you pass to a function when you call it. Inside the function it arrives as a parameter. See Functions.
assertion (assert) A check for a condition that must always be true; if it is false the program aborts. A tool for catching bugs, removed in release builds. See Error Handling.
assignment Replacing a variable's current value with a new one, e.g. x = 5. See Operators.
auto A keyword that lets the compiler deduce a variable's type from its initialiser (auto x = 5; makes x an int). The type is still fixed and checked at compile time. See Variables.
base case The case in a recursive function that can be answered directly, without recursing — it is what stops the recursion. See Recursion.
block A group of statements wrapped in curly braces { }. A block defines a scope. See Basic Structure.
breakpoint A marker that pauses a running program in the debugger so you can inspect it. See Using a Debugger.
built-in type A type the language provides directly: int, double, bool, char. See Variables.
capture The [ ] part of a lambda that lists which surrounding variables it may use, by value or by reference. See Lambda Expressions.
cast An explicit type conversion, e.g. static_cast<int>(x). See Operators.
class A user-defined type that bundles data together with the operations that work on it. See Classes.
cohesion How strongly the parts of one piece of code belong together — how focused it is on a single job. High cohesion (one clear responsibility) is the goal. See Separation of Concerns.
compile time / run time Compile time is while the compiler is building your program; run time is while the finished program is executing. C++ catches many mistakes at compile time, before the program ever runs. See Introduction.
compiler / compile The tool that translates your source code into a runnable program, before it runs. See Introduction.
composition Building a class by holding another as a member (a "has-a") instead of inheriting from it. Prefer it to inheritance unless the relationship is a genuine "is-a." See Polymorphism.
const A promise to the compiler that a value will not change; the compiler enforces it. See Variables.
const-correctness The discipline of marking everything that does not change as const — member functions that only observe, reference parameters you only read, locals you never reassign — so the compiler enforces what may be modified. A const object can call only const member functions. See Classes and Values, References & Pointers.
constructor A special member function that runs when an object is created, to set up its initial state. See Classes.
container A standard-library type that holds a collection of values, such as std::vector, std::map, or std::set. See Data Structures.
coupling How much one piece of code depends on the details of another. Loose (low) coupling — pieces connected only through narrow interfaces — is the goal. See Separation of Concerns.
dangling reference / pointer A reference or pointer to something that has already been destroyed; using it is undefined behaviour and a common cause of crashes. See Values, References & Pointers.
encapsulation Hiding a type's inner workings behind a clean interface by making its data private. See Classes.
enum class A type with a fixed set of named values (a scoped enumeration); the modern, type-safe kind of enum. See Enumerations.
exception A way to signal and handle errors, using throw, try, and catch. See Error Handling.
expression Anything that evaluates to a value — a literal, a variable, a function call, or these joined by operators (i + j). See Operators.
function A named, reusable piece of code that performs one task. See Functions.
global variable A variable declared outside every function, visible everywhere. Shared, mutable globals make code hard to follow and test; prefer locals, parameters, and return values, and keep lasting state inside an object. Global constants are fine. See Functions.
header A file (usually .hpp) whose declarations are shared across source files via #include. See Classes.
heap The region of memory for values whose size or lifetime is decided as the program runs; containers and smart pointers manage it for you (avoid raw new/delete). Contrast the stack. See Memory Management.
IDE Integrated Development Environment — the application you write, build, run, and debug code in. This course uses CLion. See Getting Started.
inheritance Building a new class on top of an existing one (class Dog : public Animal). See Polymorphism.
initialise Give a variable a value at the moment it is created. Always do this. See Variables.
iterator An object used to walk through the elements of a container. See C++ Standard Library.
lambda A small, unnamed function written inline, often passed to an algorithm. See Lambda Expressions.
linker / linking The build stage that combines the compiled pieces and libraries into the final program. "Undefined reference" is a linker error. See Reading Compiler Errors.
Liskov Substitution Principle The design rule that a derived class must be usable anywhere its base type is, without surprising code that relies on the base — an honest is-a. See Polymorphism.
LLM / AI assistant A large language model (ChatGPT, Claude, …) that can generate code — useful, but confidently wrong often enough that you must check it. See Using AI for Coding.
main The function the operating system calls to start your program. Each program has exactly one. See Basic Structure.
member function (method) An operation defined inside a class and called on an object. "Method" is a synonym. See Classes.
member initialiser list The : a(x), b(y) part of a constructor that gives data members their values before the body runs. See Classes.
move Transferring a resource from one object into another instead of copying it. See Move Semantics.
namespace A named region that groups names to avoid clashes. The standard library lives in the namespace std. See C++ Standard Library.
NaN "Not a Number" — a floating-point result of invalid maths (e.g. 0.0 / 0.0). It compares as false against everything, even itself. See Floating-Point Pitfalls.
nullptr The literal for a pointer that points at nothing. Check a pointer is not nullptr before using it. See Values, References & Pointers.
object / instance A concrete value of a class type, created from its blueprint — "instance" is a synonym. A specific Motor in memory is an object of the Motor class. See Classes.
operator A symbol such as +, ==, or && that performs an action within an expression. See Operators.
overloading Defining several functions with the same name but different parameter types; the compiler picks the right one. See Functions.
override A keyword marking a member function that replaces a base class's virtual function; the compiler checks that one really exists to override. See Polymorphism.
parameter A named input in a function's definition. The value supplied at the call site is the argument. See Functions.
PATH The list of folders the shell searches to find a program you run by name. A "command not found" is often a PATH problem. See Computer Basics.
pointer A variable that holds a memory address. It can be nullptr (pointing at nothing) and must be checked before use. See Values, References & Pointers.
polymorphism Treating different derived types through a common base interface, so the same call runs the right type's code. See Polymorphism.
predicate A function (often a lambda) that returns true or false, used by algorithms like find_if. See Lambda Expressions.
RAII "Resource Acquisition Is Initialisation" — tie a resource to an object so it is released automatically when the object goes out of scope. See RAII.
recursion A function that calls itself to solve a smaller version of the same problem, stopping at a base case. See Recursion.
reference An alias for an existing variable; it can never be null and never refers to anything else once set. See Values, References & Pointers.
Rule of Zero Design classes whose members manage themselves (containers, smart pointers) so you need write no special member functions. See Classes.
scope The region of code in which a name is valid. A variable declared in a block disappears when the block ends. See Basic Structure.
shell The program (PowerShell, bash, zsh, cmd) that interprets the commands you type in a terminal. See Computer Basics.
signature A function's name together with the number and types of its parameters — what tells one overload from another. See Functions.
smart pointer An RAII wrapper that owns heap memory and frees it automatically — std::unique_ptr, std::shared_ptr. See Memory Management.
stack The region of memory where local variables and function calls live; entries are freed automatically when they go out of scope. Contrast the heap. See Memory Management.
stack overflow A crash caused by using up the call stack, for example a recursion with no reachable base case. See Recursion.
standard library The large set of types and functions that ships with C++, all in the std namespace. (Its containers and algorithms part is informally called the STL.) See C++ Standard Library.
statement One instruction; in C++ it ends with a semicolon. See Basic Structure.
std The namespace of the standard library. std::cout means "cout, from std." See C++ Standard Library.
struct The same as a class except its members default to public. By convention used for simple bundles of data. See Classes.
template A blueprint that generates functions or classes for whatever type you use, like std::vector<T>. See Templates.
terminal A text window where you control the computer by typing commands instead of clicking. See Computer Basics.
undefined behaviour Code the language makes no promises about: it may crash, print garbage, or seem to work and break later. Avoid it. See Variables.
uninitialised variable A variable created without a value. Reading one is undefined behaviour and a rich source of bugs — always initialise. See Variables.
variable A named piece of memory that holds a value of a fixed type. See Variables.
vector The standard library's resizable array, std::vector. The list type you reach for by default. See C++ Standard Library.
virtual function A member function a derived class can override; a call through a base reference or pointer runs the actual object's version. See Polymorphism.