Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please print out this page, and then next to each statement, starting with the statement (x=a), please draw the array and the pointers involved in

image text in transcribed

Please print out this page, and then next to each statement, starting with the statement (x=a), please draw the array and the pointers involved in that statement to the right of the statement. Please don't run this program and copy the outputs. I want to make sure you do this by hand for every statement. For the printf statements, just write the values of the variables being printed to the right of the statement. This will give you practice for doing pointer arithmetic.

What to submit: Scan your handwritten work of this page and upload a PDF of this that clearly shows the pointers and the arrays involved to the right of each statement. Note that some statements have multiple arrays and pointers involved, so draw all of them to the right of the statement. Make sure you clearly show which pointer is pointing to which array element as shown in image above for the statement z=&b[2].

image text in transcribed

int *x, *y, *z, *a, *c, b[3] = {-4, 5, -6} ;

a = (int *)malloc(3*sizeof(int));

x = a;

for (int k = 1; k

a[k-1] = 3%k 2 ;

printf("%d", *x, "\t", "%d", *(x+1), "\t","%d", *(x+2), " ") ;

z = &b[2] ;

y = (++x)+1 ;

*x = *x+1 ;

printf("%d", *x, "\t", "%d", *y, "\t","%d", *z, " ") ;

*(--z) = *(y-1) + *x ;

*(z+1) = *(x+1) - 5 ;

c = x ;

printf("%d", *z, " ") ;

*y-- = (*++z) - (*&a[2]) ;

printf("%d", *z, " ") ;

printf("%d", *x+4, " ") ;

for(int j = 0 ; j

{

printf("%d", *(a+j), "\t", "%d", *(b+j), " ") ;

}

free(a);

a = NULL ;

Please print out this page, and then next to each statement, starting with the statement (x=a), please draw the array and the pointers involved in that statement to the right of the statement. Please don't run this program and copy the outputs. I want to make sure you do this by hand for every statement. For the printf statements, just write the values of the variables being printed to the right of the statement. This will give you practice for doing pointer arithmetic. =&b[2] ; b What to submit: Scan your handwritten work of this page and upload a PDF of this that clearly shows the pointers and the arrays involved to the right of each statement. Note that some statements have multiple arrays and pointers involved, so draw all of them to the right of the statement. Make sure you clearly show which pointer is pointing to which array element as shown in image above for the statement z=&b[2]. int **, *y, *z, *a, *c, b[3] = {-4,5,-6}; a = (int *)malloc(3*sizeof(int}); x= a; for (int k = 1; k

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

Advances In Databases And Information Systems 25th European Conference Adbis 2021 Tartu Estonia August 24 26 2021 Proceedings Lncs 12843

Authors: Ladjel Bellatreche ,Marlon Dumas ,Panagiotis Karras ,Raimundas Matulevicius

1st Edition

3030824713, 978-3030824716

More Books

Students also viewed these Databases questions

Question

Explain the nature of human resource management.

Answered: 1 week ago

Question

Write a note on Quality circles.

Answered: 1 week ago

Question

14-18 Compare the two major types of planning and control tools.

Answered: 1 week ago