The difference between Boolean, Boolean, BOOL, and bool in iOS

Source: Internet
Author: User

The difference between Boolean, Boolean, BOOL, and bool in iOS

  1. BOOL T1 =1;//true or False
  2. BOOL t2 = 3;//yes or NO
  3. Boolean t3 = 1; unsigned char type
  4. boolean_t T4 = 1;//int type
  5. Nsassert (t1,@ "bool T1 is NO");//Pass Test
  6. Nsassert (t2,@ "BOOL T2 is NO");//Pass Test
  7. Nsassert (t3,@ "Boolean T3 is NO");//Pass Test
  8. Nsassert (t4,@ "boolean_t T4 is NO");//Pass Test

BOOL is of type int, bool B when b!=0 has b=true

BOOL is unsigned char type, BOOL B when b=1 has B=yes

Boolean is a char type

boolean_t is an int type

Note: As long as the value of the variable is not zero, the condition is established as the above type as a criterion.

The difference between Boolean, Boolean, BOOL, and bool in iOS

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.