Escape Character, Escape Character Table

Source: Internet
Author: User

Escape Character, Escape Character Table


The escape character is a special character constant. The escape character starts with a backslash "\" followed by one or more characters. An escape character has a specific meaning, which is different from the original meaning of the character, so it is called an "escape" character. For example, the "\ n" used in the format string of the previous example printf function is an escape character, which means "carriage return and line feed". Escape characters are mainly used to represent control codes that are not easily represented by ordinary characters.
Common escape characters and their meanings
Escape character meaning of escape character
\ n carriage return
\ t Skip to next tab position
\ v vertical tab vertical tab
\ b backspace
\ r enter
\ f Form feed
\\ backslash character "\"
\ 'Single quote
\ a ringing
\ ddd Characters represented by 1 to 3 octal numbers
\ xhh Characters represented by 1 to 2 digit hexadecimal numbers
Broadly speaking, any character in the C language character set can be represented by escape characters. \ ddd and \ xhh were proposed for this purpose. ddd and hh are ASCII codes in octal and hexadecimal, respectively. For example, \ 101 means the word? Quot; A ", \ 102 means the letter" B ", \ 134 means a backslash, \ XOA means a line feed, etc.


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.