Font size
WorksheetsCSNP-04103 Chapter 6 - Functions
Total questions: 10
Worksheet time: 5mins
What are the methods used to pass parameters to a function in C++?
Call by memory
Call by reference
Call by duplicating the argument
Call by value
Select all that apply. Functions can:
Return no value
Return exactly one value
Return more than one value
None of the above
In C++ What is the symbol used to tell the compiler that you are sending a parameters to a function by reference?.
&&
@
*
&
In C++ when sending parameters by reference the & is placed.
&<Data Type>
<Data Type>&
<Data Type> <Variable Name>&
<Data Type> <Constant Name>&
In C++ if you are calling a function passing parameters by reference, the function itself must be of type:.
void
int
float
string
In C++ When passing parameters by reference to a function, you are passing:
A copy of the value in the calling function.
The value of the parameters in the calling function
The memory address of the variable in the calling function
None of the above.
In C++, If you need to send a value to a function by using parameters, and you do not need to return anything from the function, what type of call will you use:
Call by Value
Call by Reference
Call by Cellular phone
A void call
In C++, if a function receives a parameter by reference and it changes the value, what happens?.
Nothing
The value of the variable in the calling function will be changed as well
You will get a compiler error
Unlimited loop
When calling a function by reference, does C++ makes any distinction between an output and input / output parameters?.
Yes
No
In C++ when using functions, what is an alternative to get values back to the calling function other than a call by reference or using global variables?
There is no alternative
Use the return clause
Use a void function
Make a call by value
