2.5 — Introduction to local scope
Local variables Variables defined inside the body of a function are called local variables (as opposed to global variables, which we’ll discuss in a future chapter): int add(int x, int y) { int z{ x + y }; // z is a local variable return z; } Function parameters are …