The -> operator
-> operator — shorthand for dereferencing a pointer and accessing a member. Equivalent to (*pointer).member. Building a class with a header file
enum class
You can think of these as a variable, but ahead of time it is constrained to a specific set of values. Definition of a Dangling Pointer
Dangling pointer — a pointer that points to memory that no longer belongs to you. The object it pointed to has been destroyed, but the pointer still holds its old address. Address of Operator
Definition of a Caller
Caller — the function that calls another function. Passing Functions (Callbacks)
In C++, functions can be passed as parameters to other functions using function pointers, allowing you to decide what code runs without hardcoding it. The receiving function holds onto the address of the passed function and calls it at the right time. This is the foundation of event-driven programming, where you say "call this function when something happens" |
Defnition of a Thread
An independent sequence of execution within a program. The OS can run multiple threads concurrently, each doing their own work, while sharing the same memory. L values (Left Values)
An lvalue (locator value) is an expression that refers to a memory location and can appear on the left-hand side of an assignment. It represents an object that persists beyond a single expression — it has an identifiable address in memory. Definition of a Static Method
A static method is a function that belongs to the class itself rather than to any instance of it. It has no access to instance attributes and can be called without ever creating an object. Definition of a Signature
A function signature in C++ is the part of a function declaration that identifies it uniquely to the compiler. It consists of: Function name Parameter types (number, order, and types) Reference declaration (in type declarations)
bitwise OR assignment operator
Claude responded: Bitwise OR assignment (|=) — takes the existing bits of the left operand, ORs them column by column with the bits of the right operand, and stores the result b…Bitwise OR assignment (|=) — takes the existing bits of the left operand, ORs them column by column with the bits of the right operand, and stores the result back into the left operand. Can only turn bits on, never off. |
Lambda Functions
The brackets tell the lambda which variables from the surrounding scope it's allowed to use, and how it remembers them. By default, a lambda body cannot see any local variable from the function it's written inside. The capture list is how you grant access, one variable (or one default rule) at a time. Constructing an obect in C++
This is how it would look in Python: variable_name = ClassName(constructor_arguments) Dereferencing a Pointer
The * in front of a pointer means "go to the address this pointer holds and give me what's there." Range Based For-Loops
A range-based for loop is a loop that iterates over every element in a collection, from the first to the last, without needing to manually manage an index or i…A range-based for loop is a loop that iterates over every element in a collection, from the first to the last, without needing to manually manage an index or iterator. const — omit if you need to modify <element> & — omit if you want a copy of each element rather than a reference Template Functions
Try Catch
Template Aliases
|
Cheatography
https://cheatography.com
C++ Cheat Sheet (DRAFT) by blakecromar
A cheatsheet for C++
This is a draft cheat sheet. It is a work in progress and is not finished yet.