c escape sequence code example

Example 1: c escape characters

Escape		HEX in ASCII	Character represented
\a			07				Alert (Beep, Bell) (added in C89)
\b			08				Backspace
\e			1B				Escape character
\f			0C				Formfeed Page Break
\n			0A				Newline (Line Feed); see notes below
\r			0D				Carriage Return
\t			09				Horizontal Tab
\v			0B				Vertical Tab
\\			5C				Backslash
\'			27				Apostrophe or single quotation mark
\"			22				Double quotation mark
\?			3F				Question mark (used to avoid trigraphs)
\nnn		any				The byte whose numerical value is given by nnn interpreted as an octal number
\xhh…		any				The byte whose numerical value is given by hh… interpreted as a hexadecimal number
\uhhhh		none			Unicode code point below 10000 hexadecimal
\Uhhhhhhhh	none			Unicode code point where h is a hexadecimal digit

Example 2: escape sequence in c

// List of Escape Sequences in C
// Escape Sequence	Meaning
// \a	            Alarm or Beep
// \b	            Backspace
// \f	            Form Feed
// \n	            New Line
// \r	            Carriage Return
// \t	            Tab (Horizontal)
// \v	            Vertical Tab
// \\	            Backslash
// \'	            Single Quote
// \"	            Double Quote
// \?	            Question Mark
// \nnn	            octal number
// \xhh	            hexadecimal number
// \0	            Null

Tags:

Cpp Example