I want to learn about two of the escape characters.
\N where N is an octal constant
\xN where N is an hexadecimal constant
Where and how can I use it. I couldn't use it in printf.
Can you show me an example?
I want to learn about two of the escape characters.
\N where N is an octal constant
\xN where N is an hexadecimal constant
Where and how can I use it. I couldn't use it in printf.
Can you show me an example?
If you cannot type a character, but you know its number, that's when you can use it. For example, a specific number in an encoding might refer to a Japanese kanji, or an umlaut a in German, or a Cyrillic letter. One place they would be used is in string tables (but not std::string) for an application that needs to know how to display things in various languages.
Use the '\o' escape sequence like you use the '\x' one to print octal values as characters.
Originally Posted by The Jargon File
You might have seen, something like \033 which is an octal character constant - exactly \###.
Last edited by whiteflags; 02-24-2011 at 08:03 PM.