Back
Uncategorized

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

check page 11, 7,5 of the lecture note
#include <stdio.h>
int main(void)
{
int array[] = {9,4,5,3,8,2,1,6};
int *ptr;
int *qtr;
int **pptr;
int i = 0;

ptr = array;
qtr = &array[6];

printf(“%dn”,*ptr – *qtr); // Output:__________________________________

ptr = ptr + 2;

ptr[1] = *qtr;

for(i = 0; i < 8; i++)
printf(“%d “, array[i]); // Output:________________________________________

printf(“n”);

pptr = &qtr;

printf(“%dn”,**pptr); // Output:__________________________________

return 0;
}

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount! Use Discount Code “Newclient” for a 15% Discount!NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

The post c program memory diagram with pointers appeared first on Nursing Writers Hub.