Which of these remarks about formal parameters is correct?

a. A formal parameter is a kind of place holder that is filled with the argument at the time of call to the function.
b. A call-by-value formal parameter is a global variable that is initialized to the value set just before the function is called.
c. A call-by-reference formal parameter is modeled on a substitution mechanism. The argument should be an expression, not a variable, since there is never a need to assign such a variable.
d. The & (ampersand) character is used to indicate call-by-reference. This is done by placing the & after the type name which is followed by the parameter name in the definition of the parameter in the function header.
e. The argument corresponding to a call-by-value parameter cannot be changed by anything that happens in the function call.


a) d) e) are correct.
Explanation: b) a call-by-value formal parameter is a local variable that is initialized to the value of the argument at the time of the call. c) a call-by-reference parameter is modeled on a substitution mechanism. The behavior is as if the parameter were substituted in the body the function wherever the parameter is used. Fetching the value of the parameter fetches the value of the argument, assigning the parameter assigns the argument.

Computer Science & Information Technology

You might also like to view...

_________ provides service to customers in the form of software, specifically application software, running on and accessible in the cloud.

A) ?IaaS? B) SaaS C) ?RaaS ? D) PaaS

Computer Science & Information Technology

Pressing the Tab key in the last cell in a spreadsheet creates a blank row

Indicate whether the statement is true or false

Computer Science & Information Technology

The ____ relate to how programs are operating and are typically used by application or system programmers.

A. debug logs B. admin logs C. system logs D. analytic logs

Computer Science & Information Technology

Access lists can take the place of more advanced security measures, such as firewalls.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology