LearnFrenzy
Sign in Take a free test

C Variables · Variables MCQ · Question 8

Can you take the address of a register variable? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 8 Back to Exercise

Which is true about register int i;?

  • A It is guaranteed to be stored in a CPU register
  • B Its address cannot be taken with & Correct
  • C It is visible in other files
  • D It starts at 0
Correct Answer: Option B

register is only a hint, and modern compilers ignore it. The one rule it still enforces is that &i is an error, because registers have no memory address.

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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links