how can we use these escape sequence, and also octal number(\010) and hexadecimal number given(\xhh)?
what is the use of carriage return (\r), form feed(\f),bell(\a) in c++?
Collapse
X
-
In general, character or string literals contain printable ASCII characters (for example, 'A', "ABC def 123.") Sometimes you want to include one or more nonprintable characters in a string. That's what escape sequences are for. Some nonprintable characters are used so often that shorthand sequences were defined for them ("\r", '\n', "\a", etc.). If there is no shorthand escape sequence for the code you want, therer is always the option of using a numeric sequence ('\x1' or "\001"). You can choose between hexadecimal or octal based on your personal preference.Comment
Comment