Advertisement
ec429

Stupid C Trick

Sep 29th, 2016
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.22 KB | None | 0 0
  1. /* Each of A and B do their own things then fall through into C */
  2. switch(v) {
  3. case A:
  4.     // do A things
  5.     if (0) {
  6.         /* FALL THRU */
  7. case B:
  8.         // do B things
  9.     }
  10.     /* FALL THRU */
  11. case C:
  12.     // do C things
  13.     break;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement