LearnFrenzy
Sign in Take a free test

Control Instructions · Control Instructions MCQ · Question 11

What does [[fallthrough]] do in C23? Answer, explanation & discussion

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

What is the purpose of [[fallthrough]]; at the end of a case in C23?

  • A It works like break
  • B It marks a deliberate fall-through, so the compiler does not warn about it Correct
  • C It jumps to default
  • D It makes the next case run twice
Correct Answer: Option B

The attribute documents intent. With -Wimplicit-fallthrough the compiler can then warn about every unmarked fall-through, which is almost always a forgotten break.

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