Last active
February 11, 2023 01:56
-
-
Save ae-s/3132566 to your computer and use it in GitHub Desktop.
Fun with C: Braces Optional
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gcc switch-foo.c -o switch-foo | |
$ ./switch-foo | |
Got 1 for 1 | |
$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* switch-foo.c */ | |
#include <stdio.h> | |
int main() | |
{ | |
switch (1) | |
case 1: | |
puts("Got 1 for 1"); | |
switch (0) | |
case 1: | |
puts("Got 1 for 0"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment