Most people that have read ISO 9899:1999 (aka. C99) will know this but for those of you who haven’t read it yet.. Read it! Well, trigraphs is a funny Standard feature of the C language’s pre-processor. They are sequences of three letter words that are being replaced by the C pre-processor. The complete list is:
??= # ??( [ ??/ \ ??) ] ??' ^ ??< } ??! | ??> } ??- ~
And can be found at paragraph 184.108.40.206 of the IEC/ISO 9899:1999 standard. And here is some fun things that you can do with these:
sh-3.2$ cat tri.c< ??=include <stdio.h> int main(void)??<printf("??(Hello World??)??/n??'_??'??/n");return 0;??> sh-3.2$ gcc tri.c -trigraphs -o tri -std=c99 -pedantic sh-3.2$ ./tri [Hello World] ^_^ sh-3.2$
Yeah… useless.. But still fun!