Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions