Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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) :-)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote