Skip to content

Instantly share code, notes, and snippets.

@ae-s
Last active February 11, 2023 01:56
Show Gist options
  • Save ae-s/3132566 to your computer and use it in GitHub Desktop.
Save ae-s/3132566 to your computer and use it in GitHub Desktop.
Fun with C: Braces Optional
$ gcc switch-foo.c -o switch-foo
$ ./switch-foo
Got 1 for 1
$
/* 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