What do you mean by escape sequences in c++? Explain with example?
Answers
Answered by
0
Escape sequences are used in the programming languages C and C++, and their design was copied in many other languages such as Java and C#. 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.
An escape sequence provides special formatting control. An escape sequence consists of a backslash followed by a single character. Some character such as line feed, form feed, vertical tab, alert etc. cannot be typed through the keyboard. Such invisible characters can be made understood to the ‘C’ compiler through the use of execution characters or escape sequences. The term execution characters and escape sequences are used interchangeably. Escape sequence begins with \ sign.
The three escape sequences are describe below:
\n takes the cursor to the beginning of the next line; \t takes the cursor to the next horizontal tab stop; \v takes the cursor to the next vertical tab stop;
Answered by
1
An escape sequence in C language is a sequence of characters that doesn't represent itself when used inside string literal or character. It is composed of two or more characters starting with backslash \. For example: \n represents new line.
Similar questions
English,
6 months ago
English,
6 months ago
Math,
6 months ago
Business Studies,
11 months ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago