New
#1
C++ Question
I am working on my homework and need help figuring out a tough question.
2) When you call a function, as in the area and perimeter of a past assignment, you include the values to be sent to the function (the arguments) in parentheses
and the function must have been defined with parameters of an equivalent type, that will be used to receive those values
If the function is called using variables, as in cout << area(length, width) for instance, what is passed to the parameters is a copy of the values in those variables.
This is called call-by-value. In that case, the receiving parameters in the function are initialized to the contents of the two argument variables (length and width, in our example).
Based on this, given the following function:
void f (int i )
{
i = 57;
}
assuming it is called like this:
f(value)
where value is a variable of type int, defined as int value = 9; what would be the result of printing variable value after the call? Explain