Escape sequences are used in the programming languages C and C++, and their design was copied in many other languages such as Java, PHP, C#, etc. An escape sequence is a sequence of characters that does not represent itself when used inside a character or string literal, but is translated into another character or a sequence of characters that may be difficult or impossible to represent directly. In C, all escape sequences consist of two or more characters, the first of which is the backslash, (called the "Escape character"); the remaining characters determine the interpretation of the escape sequence. For example, is an escape sequence that denotes a newline character. Motivation Suppose we want to print out on one line, followed by on the next line. One could attempt to represent the string to be printed as a single literal as follows: #include <stdio.h> int main() { printf("Hello, world!"); return 0; } This is not valid in C, since a string literal may not span multiple logical source lines. This can be worked around by printing the newline character using its numerical value ( in ASCII), #include <stdio.h> int main() { printf("Hello,%cworld!", 0x0A); return 0; } This instructs the program to print , followed by the byte whose numerical value is , followed by . While this will indeed work when the machine uses the ASCII encoding, it will not work on systems that use other encodings, that have a different numerical value for the newline character. It is also not a good solution because it still does not allow to represent a newline character inside a literal, and instead takes advantage of the semantics of printf. In order to solve these problems and ensure maximum portability between systems, C interprets inside a literal as a newline character, whatever that may be on the target system: #include <stdio.h> int main() { printf("Hello,\nworld!"); return 0; } In this code, the escape sequence does not stand for a backslash followed by the letter , because the backslash causes an "escape" from the normal way characters are interpreted by the compiler. After seeing the backslash, the compiler expects another character to complete the escape sequence, and then translates the escape sequence into the bytes it is intended to represent. Thus, represents a string with an embedded newline, regardless of whether it is used inside or anywhere else. This raises the issue of how