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 …

4.2 — Void

Void is the easiest of the data types to explain. Basically, means “no type”! Consequentially, variables can not be defined with a type of void: void value; // won’t work, variables can’t be defined with a void type Void is typically used in several different contexts. Most commonly, void is …

2.4 — Introduction to function parameters and arguments

In the previous lesson, we learned that we could have a function return a value back to the function’s caller. We used that to create a modular getValueFromUser function that we used in this program: #include <iostream> int getValueFromUser() { std::cout << “Enter an integer: “; int input{}; std::cin >> …