0% found this document useful (0 votes)
49 views3 pages

Riphah International University Islamabad: Escape Sequence of C++

Escape sequences are used in C and C++ programming to represent non-printable characters like newlines, tabs, and quotes using a backslash followed by another character. Common escape sequences include \n for newline, \t for tab, \r for carriage return, and \\ for backslash. The document provides a table listing various escape sequences and what they represent for output formatting and control purposes.

Uploaded by

Maha Batool
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views3 pages

Riphah International University Islamabad: Escape Sequence of C++

Escape sequences are used in C and C++ programming to represent non-printable characters like newlines, tabs, and quotes using a backslash followed by another character. Common escape sequences include \n for newline, \t for tab, \r for carriage return, and \\ for backslash. The document provides a table listing various escape sequences and what they represent for output formatting and control purposes.

Uploaded by

Maha Batool
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Riphah International University Islamabad

Faculty Of Engineering And Applied Sciences

Name: Nouman Arshad Roll No: 09B12CE CMS No: 2132 Semester: 6(A) Subject: Introduction To Programming Topic: Escape Sequence of C++ Submitted To: Sir Muhammad Bilal Butt

ESCAPE SEQUENCE
Escape sequences are used in programming languages C and C++. These are character combinations which comprise a backslash (\) followed by some character. They give results such as getting to the next line or a TAB space. They are called escape sequences since the backslash causes an "escape" from the normal way characters are interpreted by the compiler. Escape sequences are typically used to specify actions such as carriage returns and tab movements on terminals and printers. They are also used to provide literal representations of nonprinting characters and characters that usually have special meanings, such as the double quotation mark ("). The following table lists the ANSI escape sequences and what they represent. Escape sequences allow you to send non-graphic control characters to a display device. For example, the ESC character (\033) is often used as the first character of a control command for a terminal or printer. Some escape sequences are device-specific. For instance, the vertical-tab and form feed escape sequences (\v and \f) do not affect screen output, but they do perform appropriate printer operations. The most popular escape sequences you will be using are the new line (n) and the horizontal tab (t). The new line can also be substituted with endl and the result will be the same. \n \t \v \b \r \f \a \\ \? \' \" Newline Horizontal Tab Vertical Tab Backspace Carriage Return Form feed Audible Alert (bell) Backslash Question mark Single quote Double quote

\xhh Hex number Escape Sequence \a \b \f \n \r \t \v \' \" \\ \? \ ooo \x hh \x hhhh Represents Bell (alert) Backspace Form feed New line Carriage return Horizontal tab Vertical tab Single quotation mark Double quotation mark Backslash Literal question mark ASCII character in octal notation ASCII character in hexadecimal notation Unicode character in hexadecimal notation if this escape sequence is used in a wide-character constant or a Unicode string literal.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy