In This Chapter
Passing data to functions
Naming functions with different arguments
Creating function prototypes
Passing by value versus passing by reference
Providing default values for arguments
The programs developed in prior chapters have been small enough that they can be easily read as a single unit. Larger, real-world programs are often many thousands if not millions of lines long. Developers need to break up these monster programs into smaller chunks that are easier to conceive, describe, develop, and maintain.
C++ allows programmers to divide their code into just such chunks known as functions. A function is a small block of code that can be executed as a single entity. This allows the programmer to divide her program into a number of such entities, each that implements some well-defined subset of the overall program. Functions ...