Glossary
A comprehensive reference of C++ terms used throughout this guide.
Abstract Class
Section titled “Abstract Class”A class that cannot be instantiated directly because it contains at least one pure virtual function. Serves as a base class defining an interface that derived classes must implement. First appears in Module 04
Access Specifier
Section titled “Access Specifier”Keywords (public, private, protected) that control the visibility of class members. Public members are accessible everywhere, private only within the class, protected within the class and derived classes. First appears in Module 00
Address
Section titled “Address”A unique identifier for a location in memory, typically represented as a hexadecimal number. Pointers store addresses. First appears in Module 01
Base Class
Section titled “Base Class”A class from which other classes inherit. Also called a “parent class” or “superclass.” The base class provides common functionality to its derived classes. First appears in Module 03
An operation that converts a value from one type to another. C++ provides four cast operators: static_cast, dynamic_cast, const_cast, and reinterpret_cast. First appears in Module 06
A user-defined type that encapsulates data (attributes) and functions (methods) that operate on that data. Classes are the foundation of object-oriented programming in C++. First appears in Module 00
Compilation
Section titled “Compilation”The process of converting source code into machine code. In C++, this involves preprocessing, compiling, and linking stages. First appears in Module 00
A keyword that declares a variable, parameter, or member function as constant (immutable). Const-correctness is an important C++ practice. First appears in Module 00
Constructor
Section titled “Constructor”A special member function called automatically when an object is created. Used to initialize object data. Has the same name as the class and no return type. First appears in Module 00
Container
Section titled “Container”A class that stores a collection of elements. The STL provides containers like vector, list, map, stack, and queue. First appears in Module 08
Copy Constructor
Section titled “Copy Constructor”A constructor that creates a new object as a copy of an existing object. Takes a const reference to an object of the same class. Part of the Orthodox Canonical Form. First appears in Module 02
Deep Copy
Section titled “Deep Copy”Copying an object by duplicating all its data, including dynamically allocated memory. Contrast with shallow copy, which only copies pointers. First appears in Module 02
Derived Class
Section titled “Derived Class”A class that inherits from a base class. Also called a “child class” or “subclass.” Gains access to non-private members of its base class. First appears in Module 03
Destructor
Section titled “Destructor”A special member function called automatically when an object is destroyed. Used to clean up resources. Named with a tilde prefix: ~ClassName(). First appears in Module 00
Diamond Problem
Section titled “Diamond Problem”An ambiguity that arises in multiple inheritance when a class inherits from two classes that share a common base class. Solved with virtual inheritance. First appears in Module 03
Encapsulation
Section titled “Encapsulation”The OOP principle of bundling data with the methods that operate on it, and restricting direct access to internal data. Achieved through access specifiers. First appears in Module 00
Exception
Section titled “Exception”An event that disrupts normal program flow, typically an error condition. C++ uses try, catch, and throw for exception handling. First appears in Module 05
Header File
Section titled “Header File”A file (.hpp or .h) containing declarations of classes, functions, and variables. Included in source files with #include. First appears in Module 00
The region of memory used for dynamic allocation (via new/delete). Objects on the heap persist until explicitly deleted. Contrast with stack. First appears in Module 01
Inheritance
Section titled “Inheritance”The OOP mechanism where a class (derived) acquires properties and behaviors from another class (base). Establishes an “is-a” relationship. First appears in Module 03
Instance
Section titled “Instance”A specific object created from a class. When you use new or declare a variable of a class type, you create an instance. First appears in Module 00
Interface
Section titled “Interface”A class with only pure virtual functions, defining a contract that implementing classes must fulfill. By convention, interface names often start with ‘I’. First appears in Module 04
Iterator
Section titled “Iterator”An object that points to an element in a container and can traverse through the container’s elements. Similar to pointers but more generic. First appears in Module 08
Linker
Section titled “Linker”The tool that combines compiled object files into an executable. Resolves references between files. First appears in Module 00
Memory Leak
Section titled “Memory Leak”A bug where dynamically allocated memory is never freed, causing the program to consume increasing amounts of memory. Prevented by proper use of delete or RAII. First appears in Module 01
Method
Section titled “Method”A function defined inside a class. Also called a “member function.” Methods can access the class’s private data. First appears in Module 00
Namespace
Section titled “Namespace”A declarative region that provides scope to identifiers inside it. Prevents name collisions. The standard library uses std:: namespace. First appears in Module 00
Object
Section titled “Object”An instance of a class. Contains data (attributes) and can perform actions (methods). First appears in Module 00
Operator Overloading
Section titled “Operator Overloading”Defining custom behavior for operators (+, -, <<, etc.) when used with user-defined types. Allows natural syntax for class operations. First appears in Module 02
Orthodox Canonical Form (OCF)
Section titled “Orthodox Canonical Form (OCF)”A C++ design pattern requiring classes to implement four special members: default constructor, copy constructor, copy assignment operator, and destructor. First appears in Module 02
Override
Section titled “Override”Providing a new implementation for a virtual function in a derived class. The derived version is called instead of the base version. First appears in Module 03
Pointer
Section titled “Pointer”A variable that stores a memory address. Declared with *. Can be dereferenced to access the value at that address. First appears in Module 01
Polymorphism
Section titled “Polymorphism”The ability to treat objects of different types through a common interface. In C++, achieved through virtual functions and inheritance. First appears in Module 04
Pure Virtual Function
Section titled “Pure Virtual Function”A virtual function declared with = 0 that has no implementation in the base class. Makes the class abstract. First appears in Module 04
RAII (Resource Acquisition Is Initialization)
Section titled “RAII (Resource Acquisition Is Initialization)”A C++ idiom where resources are acquired in constructors and released in destructors. Ensures automatic cleanup even when exceptions occur. First appears in Module 02
Reference
Section titled “Reference”An alias for an existing variable. Declared with &. Must be initialized and cannot be reassigned. Safer than pointers for many use cases. First appears in Module 01
The region of code where a variable or identifier is valid. Variables go out of scope when their block ends. First appears in Module 00
Shallow Copy
Section titled “Shallow Copy”Copying an object by copying only its immediate values, including pointer addresses. Can lead to double-delete bugs. Contrast with deep copy. First appears in Module 02
The region of memory used for local variables and function calls. Automatically managed (LIFO). Limited size. Contrast with heap. First appears in Module 01
Static
Section titled “Static”A keyword with multiple meanings: static member variables are shared across all instances, static member functions can be called without an object, static local variables persist between function calls. First appears in Module 00
Template
Section titled “Template”A blueprint for creating generic classes or functions that work with any data type. The compiler generates specific versions as needed. First appears in Module 07
Virtual Function
Section titled “Virtual Function”A member function declared with virtual that can be overridden in derived classes. Enables runtime polymorphism through dynamic dispatch. First appears in Module 04
Virtual Table (vtable)
Section titled “Virtual Table (vtable)”A hidden table of function pointers used by the compiler to implement virtual function dispatch. Each class with virtual functions has a vtable. First appears in Module 04
Quick Reference by Module
Section titled “Quick Reference by Module”| Module | Key Terms |
|---|---|
| 00 | Class, Object, Constructor, Destructor, Namespace, const, static |
| 01 | Pointer, Reference, Stack, Heap, Memory Leak, Address |
| 02 | OCF, Copy Constructor, Deep Copy, Shallow Copy, Operator Overloading, RAII |
| 03 | Inheritance, Base Class, Derived Class, Override, Diamond Problem |
| 04 | Polymorphism, Virtual Function, Abstract Class, Interface, vtable |
| 05 | Exception |
| 06 | Cast (static, dynamic, const, reinterpret) |
| 07 | Template |
| 08-09 | Container, Iterator |