Consider the following C++ program source code: int global; int procedure(int va
ID: 3553535 • Letter: C
Question
Consider the following C++ program source code:
int global;
int procedure(int val1. int &val2, int * val3)
{
static int flag=0;
int global;
flag ++:
val1++:
val2++;
(*val3)++;
global = val1 + val2 + *val3;
return global + flag;
}
int main()
{
int num1 = 5, num2 = 6, *pt
global = 9;
cout << procedure(global, num1, &num2);
pt = new int;
*pt =4;
cout << procedure(num1, num2, pt);
delete pt;
return 0;
}
fill in a table with the following headings with all the memory locations created in this program.
Variable/parameter?
Where is memory location allocated?
When is memory location allocated?
When is memory location deallocated?
Explanation / Answer
DONE EXACTLY AS PER SPECIFICATIONS (Ask if you need more explanation) :-)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.