Return
to Chapter 8
Basic Definitions:
-
Subprogram Definition - the interface to, and the actions
of the abstraction.
(pass parameters to get interface, the abstraction means solving for small
problems)
-
Subprogram Call - explicit request to execute the subprogram.
-
Subprogram Header - the first line of definition.
(define formal parameter and return value, e.g. C++ has void, int,... return
data types)
(e.g. SUBROUTINE
ADDER(parameters) FORTRAN
procedure
ADDER(parameters)
Ada
void
adder(parameters)
C)
-
Parameter Profile - the number, order, and types of formal
parameters.
-
Protocal - profile and return type.
-
Prototype - In C++, a function prototype tells the
compiler the type of data returned by the function, the number
of parameters the function expects to receive, the types of parameters
and the order in which these parameters are expected.
The compiler uses function prototypes to validate function calls.