C program(memory diagram with pointers)

C program(memory diagram with pointers)

What are the outputs of the following program. Explain with the help of the memory model as it was shown 

in the lecture. 

http://teg.uwasa.fi/courses/tlte2110/lectures/Lecture_4.pdf_x000D_ _x000D_ check page 11, 7,5 of the lecture note_x000D_
#include <stdio.h> _x000D_
int main(void) _x000D_
{ _x000D_
 int array[] = {9,4,5,3,8,2,1,6}; _x000D_
 int *ptr; _x000D_
 int *qtr; _x000D_
 int **pptr; _x000D_
 int i = 0; _x000D_
 _x000D_
 _x000D_
 ptr = array; _x000D_
 qtr = &array[6]; _x000D_
 _x000D_
 printf("%dn",*ptr - *qtr); // Output:__________________________________ _x000D_
 _x000D_
 ptr = ptr + 2; _x000D_
 _x000D_
 ptr[1] = *qtr; _x000D_
 _x000D_
 for(i = 0; i < 8; i++) _x000D_
 printf("%d ", array[i]); // Output:________________________________________ _x000D_
 _x000D_
 printf("n"); _x000D_
 _x000D_
 pptr = &qtr; _x000D_
 _x000D_
 printf("%dn",**pptr); // Output:__________________________________ _x000D_
 _x000D_
 return 0; _x000D_
} 

"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.


Discount Code: CIPD30



Click ORDER NOW..

order custom paper