Consider the function
```
void doStuff(int parValue, int& parRef)
{
parValue = 100;
cout << “parValue in call to doStuff = “
<< parValue << endl;
parRef =222;
cout << “parRef in call to doStuff = “
<< parRef << endl;
}
```
and consider the call, which we assume is in a complete and correct program
```
int n1 = 1, n2 =2;
doStuff(n1, n2);
```
a) The call to doStuff results in the assignment n1 = 222;
b) The call to doStuff results in the assignment n2 = 222;
c) The call to doStuff results in the assignment n1 = 100;
d) The call to doStuff results in the assignment n2 = 100;
e) There is no effect on either of these variables..
b) The call to doStuff results in the assignment n2 = 222;
The parameter parRef is a reference parameter, the argument corresponding to this is n2. The function doStuff contains an assignment, parRef = 222; The function doStuff behaves the assignment n2 = 222; were executed.
You might also like to view...
What must you do before adding a primitive type to a vector?
What will be an ideal response?
Why might you run the shutdown command with the /t switch?
A. To TRACK programs as they shutdown B. To send TRAP messages before shutdown C. To TEMPORARY shutdown the computer D. To delay the time the computer takes to shutdown
Which of the following is NOT an example of an audio-visual communication tool?
A. VoIP B. podcast C. text messaging D. Web conferencing
The OS provides its services through a well-defined ____.
A. GUI B. UI C. command line interface D. API