2.12 — Header guards

In lesson , we noted that a variable or function identifier can only have one definition (the one definition rule). Thus, a program that defines a variable identifier more than once will cause a compile error: int main() { int x; // this is a definition for variable x int …

11.17 — An introduction to std::vector

In the previous lesson, we introduced std::array, which provides the functionality of C++’s built-in fixed arrays in a safer and more usable form. Analogously, the C++ standard library provides functionality that makes working with dynamic arrays safer and easier. This functionality is named std::vector. Unlike std::array, which closely follows the …

O.3 — Bit manipulation with bitwise operators and bit masks

In the previous lesson on bitwise operators (), we discussed how the various bitwise operators apply logical operators to each bit within the operands. Now that we understand how they function, let’s take a look at how they’re more commonly used. In order to manipulate individual bits (e.g. turn them …