What is the difference between a character type and a string type in C language?

Source: Internet
Author: User

There is only a character type in C, and there is no string type. The character type is represented by a signed 8-bit binary code with the same properties as int, with only one byte. The ASCII encoding that represents the character uses the 0~127 in it, so understand that the character type (char) is actually a one-byte integer and is not just used to represent characters. Since there is no string type in C, the character array is used to manipulate the string, and the ASCII encoding of the character is stored one after another in the character array, and after the last character, a ' plus ' indicates that the string of characters ends, forming the so-called "string".

What is the difference between a character type and a string type in C language?

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.