Funky C

It’s pretty funny to know this is valid C99 code, implementing a very basic array assignment and hello world:

%:include <stdio.h>
??=include <stdlib.h>

int main(int argc, char *argv<::>) ??<
    int i??(:> = {1, 2, 3??>;
    printf("Hello world\n");
    return 0;
%>

It’s (ab)using an obscure feature in the C89 and C99 specifications called Trigraph and Digraph, when using GCC you need to pass the ‘-trigraphs’ parameter to enable this functionality. More information can be found on the Wikipedia page about it. I wonder whether people joining code obfuscation games use this.