Thursday, 15 March 2012

Escape Sequence

Escape Sequence or Execution Character


               Escape sequences are designed to liven up an otherwise dull action picture with a few hard-cutting, loud-music moments of derring-do. In a programming language, escape sequences are used to sneak otherwise forbidden characters, or characters you cannot directly type at the keyboard, into text strings.
              In the C language, escape sequences always begin with the backslash character (\). Locate the character on your keyboard now. It should be above the Enter key, though they often hid it elsewhere.
                    The backslash character signals the printf() function that an escape sequence is looming. when printf() sees the backslash, it thinks, "Omigosh, an escape sequence must be coming up," and it braces itself to accept an otherwise forbidden character.
              An escape sequence provides special formatting control. An escape sequence consists of backslash followed by a single character.

      
Escape Sequence
Purpose
\n
New line
\b
Backspace
\f
Form feed
\’
Single quote
\\
Backslash
\t
Tab
\r
Carriage return
\a
Alert
\”
Double quote

No comments:

Post a Comment