
22 Introduction to Computational Modeling
2.6 Simple Functions
A function carries out a specific task in a program and is an internal decomposi-
tion unit because every function belongs to the program.
As mentioned previously, data declared within a function is known only to that
function—the scope of the data is local to the function. The local data in a function
has a limited lifetime; it only exists during execution of the function.
2.6.1 Function Definitions
A C program is normally decomposed into source files, and these are divided into
functions. These are function definitions that implement the functions in the source
program.
FIGURE 2.2: Structure ...