Given the following definitions/declarations. const int SIZE = 10; int sum; floa
ID: 3773811 • Letter: G
Question
Given the following definitions/declarations. const int SIZE = 10; int sum; float average; string name; void square(float); function prototype consider the following list of expressions to be considered for arguments m a function call average*float(sum) average 'B' "Word" square(average) SIZE name sum List all expressions above that are valid for use as arguments with reference parameters? List all expressions above that are valid for use as arguments with value parameters? There are four functions shown in the code segment below. Assume all variables and function prototypes have been correctly declared before this segment of code and that the code compiles. Compute(inFile, MyCalc()); Average(SumUp(num), num); Which function(s) is(are) most likely value-returning function(s)? Which function(s) is(are) most likely void function(s)?Explanation / Answer
A) pass by reference is
'B'
"word"
Name
as the string is c is converted to the pointer and then its address is passed. Hence it is pass by reference.
B) Rest all the remaining are pass by value as the pointer is not passed in any cases. Hence it is pass by value.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.