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!