7.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 these …

5.1 — Constant variables (named constants)

Introduction to constants In programming, a constant is a value that may not be changed during the program’s execution. C++ supports two different kinds of constants: Named constants are constant values that are associated with an identifier. These are also sometimes called symbolic constants. Literal constants are constant values that …

4.2 — Void

Void is the easiest of the data types to explain. Basically, means “no type”! Void is our first example of an incomplete type. An incomplete type is a type that has been declared but not yet defined. The compiler knows about the existence of such types, but does not have …

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 >> …

B.1 — Introduction to C++11

What is C++11? On August 12, 2011, the ISO (International Organization for Standardization) approved a new version of C++, called C++11. C++11 adds a whole new set of features to the C++ language! Use of these new features is entirely optional — but you will undoubtedly find some of them …