The difference between Nsinteger, Nsuinteger, and int

Source: Internet
Author: User

    • int has a different maximum value and occupies a different number of digits at 32bit and 64bit.
    • With Nsinteger, the system returns the maximum value of int based on the current environment (32bit or 64bit).
    • Nsuinteger is an unsigned form of nsinteger.
    • Nsinteger is not an object, it is a typedef of the base data type, and the formatted string uses%li.
  
 
  1. #if __LP64__ || (TARGET_OS_EMBEDDED && !TARGET_OS_IPHONE) || TARGET_OS_WIN32 || NS_BUILD_32_LIKE_64
  2. typedef long NSInteger;
  3. typedef unsigned long NSUInteger;
  4. #else
  5. typedef int NSInteger;
  6. typedef unsigned int NSUInteger;
  7. #endif

The difference between Nsinteger, Nsuinteger, and int

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.