19.5 — Void pointers

The void pointer, also known as the generic pointer, is a special type of pointer that can be pointed at objects of any data type! A void pointer is declared like a normal pointer, using the void keyword as the pointer’s type: void* ptr {}; // ptr is a void …

12.3 — Lvalue references

In C++, a reference is an alias for an existing object. Once a reference has been defined, any operation on the reference is applied to the object being referenced. This means we can use a reference to read or modify the object being referenced. Although references might seem silly, useless, …

17.8 — C-style array decay

The C-style array passing challenge The designers of the C language had a problem. Consider the following simple program: #include <iostream> void print(int val) { std::cout << val; } int main() { int x { 5 }; print(x); return 0; } When print(x) is called, the value of argument x …