Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- switch (int)
- {
- case 1 :
- {
- printf("1n");
- break;
- }
- case 2 :
- {
- printf("2n");
- }
- case 3 :
- {
- printf("3n");
- }
- }
- switch (operator->num_of_operands) {
- case 2: process_operand( operator->operand_2);
- /* FALLTHRU */
- case 1: process_operand( operator->operand_1);
- break;
- }
- case 0:
- case 1:
- case 2:
- // all do the same thing.
- break;
- case 3:
- case 4:
- // do something different.
- break;
- default:
- // something else entirely.
- case optionA:
- // optionA needs to do its own thing, and also B's thing.
- // Fall-through to optionB afterwards.
- // Its behaviour is a superset of B's.
- case optionB:
- // optionB needs to do its own thing
- // Its behaviour is a subset of A's.
- break;
- case optionC:
- // optionC is quite independent so it does its own thing.
- break;
- dsend(to, from, count)
- char *to, *from;
- int count;
- {
- int n = (count + 7) / 8;
- switch (count % 8) {
- case 0: do { *to = *from++;
- case 7: *to = *from++;
- case 6: *to = *from++;
- case 5: *to = *from++;
- case 4: *to = *from++;
- case 3: *to = *from++;
- case 2: *to = *from++;
- case 1: *to = *from++;
- } while (--n > 0);
- switch(foo) {
- case 1:
- /* stuff for case 1 only */
- if (0) {
- case 2:
- /* stuff for case 2 only */
- }
- /* stuff for cases 1 and 2 */
- case 3:
- /* stuff for cases 1, 2, and 3 */
- }
Add Comment
Please, Sign In to add comment