CHAP 6 FUNCTIONS Flashcards
(21 cards)
A FUNCTION DECLARATION THAT INCLUDES THE BODY OF THE FUNCTION.
FUNCTION DEFINITION
IT ALLOWS THE CALLED FUNCTION TO DIRECTLY ALTER THE VARIABLES VALUE.
REFERENCE
When you send a parameter to a function and its value will NOT BE MODIFIED, use a [] parameter. When the function is CHANGING the actual parameter, such as in an input function, use a [] parameter.
VALUE
REFERENCE
A PROGRAM TO BE BROKEN INTO SMALL TASKS.
FUNCTIONS
A [ ] parameter is noted with an ampersand (&) following the data type of the formal parameter AND CAN RETURN A MULTIPLE VALUES.
reference
IT IS THE ACTUAL CODE OF THE FUNCTION AND ALWAYS OUTSIDE THE main( ) FUNCTION.
a
FUNCTION DEFINITION
IT IS A SET OF INSTRUCTIONS THAT IS DESIGNED TO PERFORM A SPECIFIC TASK.
FUNCTIONS
Value returning functions are used when only [ ] result is returned and that result is used [] in an expression.
ONE, DIRECTLY
A variable declared outside of all the functions in a program.
GLOBAL VARIABLE
DOES NOT RETURN A VALUE TO ITS CALLER.
VOID FUNCTION
FUNCTIONS CREATED BY A USER.
USER DEFINED
A variable declared within a block and not accessible outside of that block. When the function ends (returns) all of its [] are destroyed.
local variables
The process in which a function calls itself is known as [ ] and the corresponding function is called the [ ] function.
recursion
recursive
A formal parameter that receives a copy of the contents of the corresponding argument (actual parameter) AND RETURNS A SINGLE VALUE
VALUE
a function declaration that does not include the body of the function.
FUNCTION PROTOTYPE
TYPES OF FUNCTION
PRE-DEFINED, USER DEFINED
CAUSES THE VALUE TO BE RETURNED TO THE CALLING FUNCTION.
RETURN STATEMENT
ALREADY BEEN DEFINED AS A PART OF THE LANGUAGE.
PRE-DEFINED
IT IS USED WHEN INPUT/OUTPUT IS PERFORMED AND MORE THAN ONE VALUE IS TO BE RETURNED BY MODIFYING ONE OR MORE PARAMETERS RATHER THAN USING A RETURN STATEMENT.
VOID FUNCTION
THESE ARE SUBPROGRAMS THAT DO NOT EXECUTE UNTIL THEY CALLED.
FUNCTIONS
A formal parameter that receives the address (location in memory) of the corresponding argument (actual parameter).
REFERENCE