C++
1a) Assume that you have an integer variable named myint. Call xyzfunc and pass myint as a parameter.
a) xyzfunc(myint)
b) myint(xyzfunc)
c) xyzfunc(&myint)
c) call xyzfunc(myint)
1b) Code the function definition for xyzfunc, picking up a local copy of myint. xyzfunc has no return value.
a) void xyzfunc (int &myint);
b) void xyzfunc (myint);
c) void xyzfunc (local myint);
d) void xyzfunc (int myint);
1c) If xyzfunc executes myint++, what happens to the copy of myint in the calling program?
a) It is incrementd by one.
b) Its address is incremented by four.
c) It doesn't change.
d) It doesn't change until the function returns.
1d) Change the function definition for myint so that xyzfunc uses the same memory locations for myint as in the calling program.
a) void xyzfunc (&int myint);
b) void xyzfunc (int &myint);
c) void xyzfunc (int * &myint);
d) void xyzfunc (&int &myint);
1e) This time, if xyzfunc executes myint++, what happens to the copy of myint in the calling program?
a) Its address is incremented by four.
b) It is incremented by one.
c) It doesn't change.
d) It doesn't change until the function returns.
1)
Assume that you have an integer variable named myint. Call
xyzfunc and pass myint as a parameter.
a) xyzfunc(myint) it call function xyzfunc() and pass the value of the variable myint as parameter
1b)
Code the function definition for xyzfunc, picking up a local copy of myint. xyzfunc has no return value.
d)void xyzfunc (int myint); it declare myint lical variable for xyzfunc()function
1c) If xyzfunc executes myint++, what happens to the copy of myint in the calling program?
c) It doesn't change
1d) Change the function definition for myint so that xyzfunc uses the same memory locations for myint as in the calling program.
b) void xyzfunc (int &myint);
1e) This time, if xyzfunc executes myint++, what happens to the copy of myint in the calling program?
a) Its address is incremented by four.
Get Answers For Free
Most questions answered within 1 hours.