chapter 6 Flashcards
actual parameter
a variable or expression listed in a call to a function
automatic variable
a variable for which memory is allocated at block entry and deallocated at block exit
body (of a function)
the code within the function required to accomplish the task
Data type (of a function)
the return type of a value-returning function
Definition (of a function)
includes name of function, listing of the parameters if any, data type of each parameter, data type of value returned by the function, and the code required to accomplish the task
different formal parameter lists
when 2 or more functions with the same name have a different number of formal parameters, or if they have the same number of parameters, the data type of the parameters differ in at least 1 position
driver
program that tests a function
external variable
- a global variable declared within a function using the “extern” reserved word
- the “extern” keyword indicates that the variable is declared elseware
formal parameter
a variable declared in the function heading
function header (heading)
includes name of the function, number of parameters if any, data type of each parameter, and data type of the value returned by the function
function overloading (overloading a function name)
creating several functions with the same name but different parameters lists
function prototype
function heading without the body of the function
global identifier
identifier declared outside of every function definition
local declaration
declaration of a variable within a block of code for use only within that block
local identifier
identifier declared within a function (a block)
local variables
variables declared in the body of a function (or block) for use only within that function (or block)
module
another name for a function
nested block
block declared within another block
parameter
- identifier in a function header, which acts within the function as a regular local variable
- may be formal or actual
reference parameter
formal parameter that receives the location (memory address) of the corresponding actual parameter
return type (of a function)
- the data type of the value that the function returns
- also called the data type of the function
scope
refers to where an identifier is accessible (visible) in a program
scope resolution operator
- an operator that, when used, causes a global variable declared before the definition of a function (or block) to be accessed by the function (or block), even if the function (or block) has an identifier with the same name as the variable
- (::)
signature (of a function)
consists of the function name and its formal parameter list
static variable
variable for which memory remains allocated as long as the program executes
stub
function that is not fully coded
value parameter
formal parameter that receives a copy of the content of the corresponding actual parameter
value-returning functions
functions that have a return type
void functions
functions that do not have a data type