C # escape characters,

Source: Internet
Author: User

C # escape characters,

All ASCII codes can be represented by "\" and numbers (generally Octal numbers. C defines some common ASCII characters that cannot be displayed, such as \ 0, \ t, \ n, which are called escape characters, because the subsequent characters do not mean their original ASCII characters.

 

All escape characters and their meanings:

Escape characters

Meaning

ASCII value (decimal)

\

Bell (BEL)

007

\ B

Return to BS to move the current position to the previous column.

008

\ F

Change page (FF), move the current position to the beginning of the next page

012

\ N

Line feed (LF), move the current position to the beginning of the next line

010

\ R

Press enter (CR) to move the current position to the beginning of the line

013

\ T

Horizontal tabulation (HT) (jump to the next TAB)

009

\ V

Vertical tabulation (VT)

011

\\

Represents a backslash character ''\'

092

 

 

 

\'

Represents a single quotation mark (apostrophes) character

039

\"

Represents a double quotation mark character

034

\ 0

NULL)

000

\ Ddd

Any character from 1 to 3 octal digits

Three octal nodes

\ Xhh

Any character in hexadecimal notation between 1 and 2

Two hexadecimal

Note: Yes. slashes: "/" and backslash: "\" are not interchangeable here.

Constant

Constant represents the value that can be contained in a variable. We can use an ASCII expression to represent a constant of the escape type, or use a backslash to represent escape characters in single quotes.

'A', '\ x2f',' \ 013 ';

Where: \ x indicates that the subsequent characters are hexadecimal numbers, and \ 0 indicates that the subsequent characters are Octal numbers.

Note: In Turbo C 2.0, the number range of the constant type is-128 to 127, unless you declare it as unsigned, so that it is 0 to 255.

The \ x, \ n, \ a, and so on we have seen above are all called escape characters, which tell the compiler to use special methods for processing.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.