Question 6
Back to Exercise
int a[10]; starts at address 1000 and an int is 4 bytes. What address is &a + 1?
- A 1001
- B 1004
- C 1040 Correct
- D 1010
Correct Answer: Option C
&a is a pointer to the whole array, type int (*)[10], whose size is 40 bytes. Adding 1 moves past the entire array: 1000 + 40 = 1040. a + 1 would be 1004.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!