11.13 — For-each loops

In lesson , we showed examples where we used a for loop to iterate through each element of an array. For example: #include <iostream> #include <iterator> // std::size int main() { constexpr int scores[]{ 84, 92, 76, 81, 56 }; constexpr int numStudents{ std::size(scores) }; int maxScore{ 0 }; // …

6.3 — Local variables

In lesson , we introduced local variables, which are variables that are defined inside a function (including function parameters). It turns out that C++ actually doesn’t have a single attribute that defines a variable as being a local variable. Instead, local variables have several different properties that differentiate how local …