|
| C++ Program Design, 3/e James P. Cohoon,
University of Virginia Jack W. Davidson,
University of Virginia
Function basics
Chapter 5 OverviewFunctions improve clarity and enable software reuse. A function is like an
assistant that goes off to perform a particular task and then returns with its
solution. In the next two chapters, the design and use of functions is considered
in detail. We begin this exploration by examining fundamental concepts such
as invocation and parameter passing. We do so by developing programs that
use functions from standard software libraries including the iostream library.
The iostream library is important because it permits an extensible method of
displaying and extracting objects. The use of libraries is facilitated through
preprocessor commands. The preprocessor commands support file inclusion,
macro definitions, and conditional compilation. |
|
|