Differences between large and small bool

Source: Internet
Author: User
Someone asked me this question two days ago. I have never paid attention to it before (they all use big bool directly). I learned it online and figured out the problem. Pai_^
Differences between large and small bool:
1. Different Types
Bool is int type
Bool is Boolean
2. Different Lengths
Bool has only one byte
The bool length depends on the actual environment. Generally, it can be regarded as 4 bytes.
3. Different values
Bool values: false and true, which are the difference between 0 and 1.
Bool values: false and true, which are the difference between 0 and non-0.
4. Example
Bool x = 3; // alarm
Bool x = 1; // correct
Bool x = 3; // correct
Bool x = 3.3; // alert

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.