< previous page page_452 next page >

Page 452
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
    x = 15;
    DoReference(x);
    cout << x =  << x <<  after the call to DoReference.
         << endl;
    x = 16;
    DoValue(x);
    cout << x =  << x <<  after the call to DoValue.
         << endl;
    x = 17;
    DoLocal();
    cout << x = << x <<  after the call to DoLocal.
         << endl;
    x = 18;
    DoGlobal();
    cout << x =  << x <<  after the call to DoGlobal.
         << endl;
    return 0;
}

void DoReference( int& a )
{
    a = 3;
}

void DoValue( int b )
{
    b = 4;
}

void DoLocal()
{
    int x;

    x = 5;
}

void DoGlobal()
{
    x = 7;
}
5. What is the output of the following program?
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
#include <iostream.h>

void Test();

int main()
{

 
< previous page page_452 next page >