Question: Determine the state of memory after the following code segment. You should give the value for each declared variable. Use ampersands for pointers (arrows optional).

Determine the state of memory after the following code segment. You should give the value for each declared variable. Use ampersands for pointers (arrows optional). Use a question mark as the value for uninitialized variables (i.e. ones that havent been set in this code).

void fun(int* x, int* y, int** z) { *y = 127 *z = x; y = x; //WHAT DOES MEMORY LOOK LIKE WHEN YOU REACH HERE } int a = 141;

int b = 142; int* c = &b; fun(&a, c, &c));

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!