Question: HW7 - CSC130, C Programming 1. Why do you think the change of value of *p, to 10, in fun() was a permanent change? void

HW7 - CSC130, C Programming 1. Why do you think the change of value of *p, to 10, in fun() was a permanent change? void fun(int* p); void fun(int* p) { int q = 10; *p = q; printf("%d ", *p); } void main( ) { int r = 20; int* p = &r; fun(p); printf("%d", *p); } 2. Why do you think the value of *p: 10 stayed local to fun()? void fun(int* p); void fun(int* p) { int q = 10; p = &q; printf("%d ", *p); } void main() { int r = 20; int* p = &r; printf("%d ", *p); fun(p); printf("%d ", *p); } 3. Declare an int variable and an int pointer variable to it. Print the size of the int pointer variable using sizeof(). 4. Create any structure. Declare a variable and a struct pointer variable to it. Print the size of the struct pointer variable using sizeof(). 

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!