LearnFrenzy
Sign in Take a free test

C Const · const MCQ · Question 11

What does volatile const mean in C? Answer, explanation & discussion

  • MCQ
  • Hard
  • 0 comments
  • Answer explained
  • Moderated community
Question 11 Back to Exercise

What does volatile const uint32_t *status describe?

  • A A contradiction that does not compile
  • B Data the program must not write but that can change on its own, so every read must really access it Correct
  • C A constant that is cached
  • D A pointer that cannot move
Correct Answer: Option B

const restricts the program; volatile says the value may change outside the program (hardware, another core). A read-only hardware status register is the classic example.

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