Need help to solve this with explanation please. 8. Given the following array of
ID: 3752393 • Letter: N
Question
Need help to solve this with explanation please.
8. Given the following array of integers, what will be the output of each printfO statement? Also, fill in the blank in each printf) statement with the appropriate code, given the data type being printed. 0x194 0x198 0x19c 0x1a0 0x1a4 Oxla8 0xlacExplanation / Answer
f is 0x194 Note that when you add a number to an int pointer such as f, then program actually adds 4 times that number. a) *(f + 2) => *(0x194 + 2*4) => *(0x194 + 8) => *(0x19c) => 190 Answer: --------- printf("%d", *(f + 2)); Output: 190 b) (*f + 2) => (*0x194 + 2) => (192 + 2) => 194 Answer: --------- printf("%d", (*f + 2)); Output: 194 c) (f + 2) => (0x194 + 2*4) => (0x194 + 8) => 0x19c Answer: --------- printf("%p", (f + 2)); Output: 0x19c
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.