I am wondering if it is legal in C to literally put ascii
characters like TAB
, BEL
and ESC
directly in a string literal.
There is no way to display the characters in plain text here on Stackoverflow so I had to take a screenshot instead.
Characters that does not have a graphical representation are display using Caret notation and highlighted in purple in the screenshot. There is also a TAB
-character at line 7
that indents the text.
This compiles without any warnings using gcc -std=c99 -pedantic
, but is it really fully portable?
This is not something that I would use for any serious programs. I am just curious if it the standards allow it.