Escape Character Table and escape table

Source: Internet
Author: User

Escape Character Table and escape table

Some Characters in the ASCII table cannot be printed. How do I express these unprintable characters?

C provides three representation methods.

I. use ASCII codes directly

2. Use a special symbolic sequence, that is, escape characters.

3. C90 supports representing character constants in hexadecimal format (in this form, the backslash is followed by an x or X, followed by a 1 to 3 hexadecimal number)

Escape Character ASCII value (decimal) Meaning

\ A 7 Gbit/s (terminal bell or speaker beep)

\ B 8 return

\ F 12 Paper

\ N 10 line feed

\ R 13 press ENTER

\ T 9 horizontal Tab

\ V 11 vertical Tab

\ 92 backslash (\)

\ '39 single quotes (')

\ "34 double quotes (")

\? 63 question mark (?)

\ 0 0 NULL character (NULL)

\ Ooo octal value (o indicates an octal number)

\ Xhh hexadecimal value (h indicates a hexadecimal number)

 

These escape characters may not apply to all devices. for example, take the paper symbol (\ f) and vertical Tab character (\ v) to generate strange symbols on the screen without any cursor movement, they only work as described when output to the printer.

 

If you want to select between an escape character and its corresponding ASCII code, it is best to use the escape character. first, escape characters are easier to remember. Second, this makes the program more portable. because escape characters are still applicable in systems that do not use ASCII codes.

 

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.