Skip to content

Instantly share code, notes, and snippets.

@tangentstorm
Created February 26, 2013 21:02
Show Gist options
  • Save tangentstorm/5042164 to your computer and use it in GitHub Desktop.
Save tangentstorm/5042164 to your computer and use it in GitHub Desktop.
#include<stdio.h>
// program to challenge the assertion that
// c disallows switching on characters.
int main() {
char ch;
for (ch = 'a'; ch < 'z'; ch++) {
switch(ch) {
case 't': printf("t[angentstorm]"); break;
default : putchar(ch);
}
}
putchar('\n');
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment