Can I safely store UInt32 to NSUInteger?

Posted by mystify on Stack Overflow See other posts from Stack Overflow or by mystify
Published on 2010-05-02T15:02:05Z Indexed on 2010/05/02 15:07 UTC
Read the original article Hit count: 251

Filed under:
|
|

In the header, it is defined like:

#if __LP64__ || (TARGET_OS_EMBEDDED && !TARGET_OS_IPHONE) || TARGET_OS_WIN32 || NS_BUILD_32_LIKE_64
typedef long NSInteger;
typedef unsigned long NSUInteger;
#else
typedef int NSInteger;
typedef unsigned int NSUInteger;
#endif

So does an UInt32 fit without problems into an NSUInteger (an unsigned int)? Where's the difference between UInt32 and unsigned int?

And I assume that an unsigned long is bigger than an unsigned int?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c