Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started