Consider the function void doStuffint parValue int parRef pa
Consider the function void doStuff(int parValue, int& parRef) {parValue = 100; cout
Solution
void doStuff(int parValue, int& parRef)
{
parValue = 100; //This is a local variable, and the scope of this variable is within this function.
cout<<\"parValue in call to doStuf= \"<<parValue<<endl; //Prints the value 100.
parRef = 222; //Assigns 222 to n2.
cout<<\"parRef in call to doStuff= \"<<parRef<<endl; //Prints the value 222.
}
int main()
{
int n1 = 1, n2 = 2;
doStuff(n1, n2); //Passes the value 1, and takes the address of n2.
//By here, the value of n1 is 1, and the value of n2 is updated to 222.
}
Therefore, c. The call to doStuff results in the assignment n2 = 222. is the correct answer.
