C++ Functions

As mentioned earlier, C++ allows “top-level” functions. These are not part of any class, and are called without the name of any object or class. Otherwise, the syntax is similar to what you're used to in Java.

By default, parameters are passed by value: the parameter is essentially a variable initialized to the value of the argument.

The basic function features are common between plain C and C++, but plain C lacks reference parameters, default parameters, and function overloading.

Textbook: Chapter 7, pages 240–270. Starting on p. 270, the text discusses include files and namespaces, which we won't get into just now.