C language ' 0 ', ' 0 ', 0 difference __c language

Source: Internet
Author: User

A string constant is one or more sequence of characters, such as "0" and "search", enclosed by a pair of double quotes;

A single character with a single quote, ' Constants ' and ' 0 ';

Character constants can be used as integers to participate in related operations in the program,


In C, characters are stored in their corresponding ASCII code, one character for one byte.


The first ASCII code, the pair is 0, the corresponding character Fu Shi (null), that is, ' the ' null ' character.


Search_for[strlen (search_for) -1]= ' the ".//Hi-C language


The flag to determine whether a string is closed is to see if a ' yes ' is encountered, and if ' yes ' is encountered, the end of the string.


The ASCII code corresponding to the character ' 0 ' is 48,48 the hexadecimal number is 0x30,

The word constants amount ' 0 ' can participate in the relevant operation in the program like the reshaping constant 1 sample.

For example, converting characters to numbers is often used, such as converting ' 8 ' to a cosmetic constant of 8, ' 8+ ' 0 '.


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.