Which of the following are accurate comparisons between call-by-value and const call-by-reference?
a. Both protect against changing the caller’s argument.
b. Both are very fast for all sizes of objects.
c. Call-by-value copies the argument whereas const call-by-reference does not
d. Call by value uses more memory than const call-by-reference in making the copy.
a) , c) and d) are correct
Explanation: a) call-by-value makes a copy and uses the copy. This protects against changing the caller’s argument. Const call-by-reference provides a programming language mechanism to prevent the author of the code from writing code that will change the parameter so protects the caller’s argument. b) is wrong, call-by-value is much slower because it makes a copy.
You might also like to view...
In the United States, the release of student grade information is regulated by the __________ .
Fill in the blank(s) with the appropriate word(s).
A(n) ________ query resembles a spreadsheet-like format with column headings and row headings
A) select B) append C) crosstab D) simple select
To iterate through the entries in a directory, you open a ____________________ to the directory with the opendir() function.
Fill in the blank(s) with the appropriate word(s).
How do satellite connections to the Internet exchange data?
What will be an ideal response?