Flashcards in Ch 6 Deck (26)
Why do local variables lose their values between calls to the function in which they are defined?
Local variables lose their values to transfer the value
What is the difference between an argument and a parameter variable?
An argument is values that are sent into a function and a parameter is a variable that holds a value being passed into a function.
Where do you define parameter variables?
Define the parameter variable after the void statement in the parenthesis
If you are writing a function that accepts an argument and you want to make sure the function cannot change the value of the argument, what do you do?
Declare the function as a const.
When a function accepts multiple arguments, does it matter in what order the arguments are passed in?
Yes, when the function is written it expects each parameter to be of a certain type and in a certain order.
The __ is the part of a function definition that shows the function name, return type, and parameter list
If a function doesn’t return a value, the word ______ will appear as its return type.
Either a functions ______ or its ______ must precede all calls to the function.
Values that are sent into a function are called ______.
Special variables that hold copies of function argument are called ______.
When only a copy of an argument is passed to a function, it is said to be passed by ______
A ______ eliminates the need to place a function definition before all calls to the function.
A ______ variable is defined inside a function and is not accessible outside the function.
______ variables are defined outside all functions and are accessible to any function within their scope.
Unless you explicitly initialize global variables, they are automatically initialized to ______.
If a function had a local variable with the same name as a global variable, only the ______ variable can be seen by the function.
______ local variables retian their value between function calls.
The ______ statement causes a function to end immediately.
______ arguments are passed to parameters automatically if no argument is provided in the function call.
When a function uses a mixture of parameters with and without default arguments, the parameters with default arguments must be defined ______.
The value of a default argument must be a ______.
When used as parameters, ______ variables allow a function to access the parameters original argument.
Reference variables are defined like regular variables, except there is an ______ in front of the name.
Reference variables allow arguments to be passed by ______.
The ______ function causes a program to terminate.