Chapter 6 Function Quiz

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

When a function terminates, it always branches back to "main" regardless of where it is called from. T or F

FALSE

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

global

A (n)_____ variable is defined inside a function and is not accessible outside the function.

local

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

local

When used as parameters, _____ variables allow a function to access the parameter's original argument.

reference

The _____ statement causes a function to end immediately.

return

Special variables that hold copies of function arguments are called ________.

parameters

Overuse of global variables can lead to problems. T or F

TRUE

All static local variables are initialized to -1 by default. T or F

FALSE

Changes to a function parameter always affect the original argument as well. T or F

FALSE

Function headers are terminated with a semicolon. T or F

FALSE

Values that are sent into a function are called ________.

argument

The value of a default argument must be a (n)_____.

constant

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

definition, prototype

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

default

Reference variables are defined like regular variables, except there is a(n) __ in front of the name.

&

Arguments are passed to the function parameters in the order they appear in the function call. T or F

TRUE

It is not possible for a function to have some parameters with default arguments and some without. T or F

FALSE

Reference variables allow arguments to be passed by _____.

reference

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

0

Function prototypes are terminated with a semicolon. T or F

TRUE

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

last

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

void

The ____ function causes a program to terminate.

exit

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

global

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

parameters

A (n)_______ eliminates the need to place a function definition before all calls to the function.

prototype

______ local variables retain their value between function cells.

static

Functions should be given names that reflect their purpose. T or F.

TRUE

If other functions are defined before "main", the program still starts executing at function "main". T or F

TRUE

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

TRUE

Initialization of static local variables only happens once, regardless of how many times the function in which they are defined is called. T or F

TRUE

Many functions may have local variables with the same name. T or F

TRUE

Static local variables are not destroyed when a function returns. T or F

TRUE

The scope of the parameter is limited to the function which uses it. T or F

TRUE

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

header

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

value


Kaugnay na mga set ng pag-aaral

Chapter 06: Values, Ethics, and Advocacy

View Set

The Top 100 Most Common US DMV Questions

View Set

Abbreviations for surgical procedures

View Set

Getting Away With Murder: The True Story of the Emmett Till Case

View Set

BA exam 2 - homeworks/quiz questions

View Set