Skip to content

Instantly share code, notes, and snippets.

@KristianLyng
Created December 8, 2015 15:32
Show Gist options
  • Select an option

  • Save KristianLyng/d144b3cbd2a1963e17d8 to your computer and use it in GitHub Desktop.

Select an option

Save KristianLyng/d144b3cbd2a1963e17d8 to your computer and use it in GitHub Desktop.
kly@leia:~$ cat foo.c
#include <stdio.h>
int main(char *b, char **a)
{
b = ((int) b > 1 ? a[1] : "meh" ) -1;
while (*++b || !putchar('\n')) {
putchar(*b > 96 && *b < 123 ? *b - 32 : *b);
};
}
kly@leia:~$ gcc -Wno-pointer-to-int-cast foo.c
kly@leia:~$ ./a.out "Hei du din løk"
HEI DU DIN LøK
kly@leia:~$ ./a.out ""
kly@leia:~$ ./a.out
MEH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment