Functions
- a named block of code
- like a small program that performs some well-defined subtask
Types
Components
- declaration
- invocation
- definition
Local variables and scope:
add1.cpp,
add2.cpp.
Side effects:
an unintended consequence of the function on a variable
(side1.cpp,
side2.cpp).
Void functions: do not return a value (rect6.cpp).