Chapter 6 Review: Functions

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

prototype

A ____ eliminates the need to place a function definition before all calls to the function.

local

A ____ variable is defined inside a function and is not accessible outside the function.

prototype, definition

Either a function's ___ or its ___ must precede all calls to the function.

void

If a function doesn't return a value, the word ___ will appear as its return type

local

If a function has a local variable with the same name as a global variable, only the ____ variable can be seen by the function.

&

Reference variables are defined like regular variables, except there is a ____ in front of the name

parameters

Special variables that hold copies of function arguments are called ____

false

T/F: All static variables are initialized to -1 by default

true

T/F: Arguments are passed to the function parameters in the order they appear in the function call

false

T/F: Changes to a function parameter always affect the original argument as well

false

T/F: Function headers are terminated with a semicolon

true

T/F: Function prototypes are terminated with a semicolon

true

T/F: Functions should be given names that reflect their purpose

true

T/F: If other functions are defined before main, the program still starts executing at function main

true

T/F: In a function prototype, the names of the parameter variables may be left out

true

T/F: Initialization of static local variables happens only once

true

T/F: Many functions may have local variables with the same name

true

T/F: Overuse of global variables can lead to problems

true

T/F: Static local variables are not destroyed when a function returns

false

T/F: The exit function may only be called from main

false

T/F: When a function terminates, it always branches back to main, regardless of where it was called from

false

T/F: it is not possible for a function to have some parameters with default arguments and some without

true

T/F: the scope of a parameter is limited to the function which uses it

exit

The ____ function causes a program to terminate

function

The ____ is the part of a function definition that shows the function name, return type and parameter list.

constant

The value of a default argument must be a ____

parameters

Two or more functions may have the same name, as long as their ____ are different

zero

Unless you explicitly initialize global variables, they are automatically initialized to ____

arguements

Values that are sent into a function are called ____

last

When a function uses a mixture of parameters with and without default arguments, the parameters with default arguments must be defined ____

value

When only a copy of an argument is passed to a function, it is said to be passed by ____

reference

When used as parameters, ____ variables allow a function to access the parameters of the original argument

default

____ arguments are passed to parameters automatically if no argument is provided in the function call.

static

____ local variables retain their value between function calls

return

____ statement causes a function to end immediately

global

____ variables are defined outside all functions and are accessible to any function within their scope

global

____ variables provide an easy way to share large amounts of data among all the functions in a program

reference

reference variables allow arguments to be passed by ____


संबंधित स्टडी सेट्स

PrepU Videbeck Ch 17 Mood Disorders & Suicide

View Set

Corporate Ethics and Responsibility chapter 8

View Set

Your Money & Credit (Test 1-Ch.2)

View Set

911 Driving School test #3 review

View Set