C program.
Given the following code:
int add_and_double(int a, int b) |
where the function main() (i.e. the caller) calls the function add_and_double() (i.e. the callee).
Which of the following actions are taken when main() calls the function add_and_double()? Select all that apply.
a. |
Once the callee returns, the caller frees the stack memory for the callee's function parameters a and b. |
|
b. |
The callee allocates space on the stack for its local variable result. |
|
c. |
Before returning, the callee frees the stack memory used by its function parameters a and b. |
|
d. |
The callee allocates space on the stack for the parameters a and b; and populates a with the value 12 and b with the value 40. |
|
e. |
Once the callee returns, the caller frees the stack memory for the callee's local variable result. |
|
f. |
The caller allocates space on the stack for the callee's local variable result. |
|
g. |
The caller allocates space on the stack for the parameters a and b; and populates a with the value 12 and b with the value 40. |
|
h. |
Before returning, the callee frees the stack memory used by its local variable result. |
The correct options are :
A). Once the callee returns, the caller frees the stack memory for the callee's function parameters a and b.
B). The callee allocates space on the stack for its local variable result.
G). The caller allocates space on the stack for the parameters a and b; and populates a with the value 12 and b with the value 40.
H). Before returning, the callee frees the stack memory used by its local variable result.
Please do give a like thanks..!!
Get Answers For Free
Most questions answered within 1 hours.