Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Given the following code: int arr[5] = {5, 4, 3, 2, 1}; int *ip = arr; int **ipp

ID: 663542 • Letter: G

Question

Given the following code:

int arr[5] = {5, 4, 3, 2, 1};

int *ip = arr;

int **ipp = &ip;

   And the following constraints:

Integers are 4-bytes in length

arr is stored at memory location 0x80A0

ip is stored at location 0x6F00

ipp is stored at location 0x60C0.

Evaluate the following expressions in C (e.g. what would the output be if given to printf).
NOTE: If the output is a value write it in decimal. If it is a memory address, write it in hex.

1. (*ipp) [3]


2. ip + 2



3. *ip + 2


4. *ipp

5. *(*ipp + 1)

Explanation / Answer

CONCEPT:

We need to evaluate the given Expressions

For the given condition

it prints the values as

1. (*ipp) [3] Answer: 4

2. ip + 2    Answer: 2

3. *ip + 2    Answer: 3

4. *ipp               Answer: 1

5. *(*ipp + 1)     Answer: 3

Explanation:

thease are all of same Concept using pointers and arrays ..Pointers store address of arrays...

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote