开发者

NSInteger problem

How to use the NSInteger give ex开发者_JAVA技巧ample and simplecode


NSInteger is defined like this:

#if __LP64__ || NS_BUILD_32_LIKE_64
  typedef long NSInteger;
  typedef unsigned long NSUInteger;
#else
  typedef int NSInteger;
  typedef unsigned int NSUInteger;
#endif

It's the same as int on 32Bit or long on 64Bit.


NSInteger a, b, c;

a = 2;
b = 40;

c = a + b;

NSLog(@"THE answer is: %d\n", c);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜