Given Following Int Xyz 9 88 99 22 15 Int Ptr Xyz Assuming Xyz Stored Memory Address 2500 Q37094902

Given the following:

int xyz[9] = {88, 99, 22, 15};

int *ptr = xyz;

and assuming that xyz is stored at memory address 2500, what isthe value of each of the following?

  1. xyz[0]
  2. xyz[2]
  3. xyz[4]
  4. xyz[9]
  5. &xyz[0]
  6. ptr
  7. *ptr
  8. *ptr+1
  9. *(ptr+1)

Solution


xyz[0] is 88xyz[2] is 22xyz[4] is not validxyz[9] is not valid&xyz[0] is 2500ptr is 2500*ptr is 88*ptr+1 89*(ptr+1) 99

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.