12.13 — In and out parameters

A function and its caller communicate with each other via two mechanisms: parameters and return values. When a function is called, the caller provides arguments, which the function receives via its parameters. These arguments can be passed by value, reference, or address. Typically, we’ll pass arguments by value or by …

13.11 — Struct miscellany

Structs with program-defined members In C++, structs (and classes) can have members that are other program-defined types. There are two ways to do this. First, we can define one program-defined type (in the global scope) and then use it as a member of another program-defined type: #include <iostream> struct Employee …