Functions group program statements into logical units. We do this to encapsulate actions that functions perform. Encapsulation is important because it separates and hides a function's programming details from its caller. With libraries of functions that provide separate compilation and linking of modules, we can call functions from anywhere in a program.
As with variables, you must define or declare functions before you call them. C++ functions have two formats. The first format is a function declaration, often called a function prototype.
Type function_name(Type arg1, Type arg2, Type argN);
Function prototypes give the compiler all the information it needs to verify the correctness of a function call: the function's name, its ...