开发者

What's the purpose of unsigned type here?

开发者 https://www.devze.com 2023-01-04 00:40 出处:网络
Sorry for the multitude of开发者_JAVA百科 iPhone Programming newb questions but.. what is the reason for having an unsigned type for something such as

Sorry for the multitude of开发者_JAVA百科 iPhone Programming newb questions but..

what is the reason for having an unsigned type for something such as

- (unsigned)count

for the NSArray class.

Why not just define it as

- (int)count

?


An array can't have a negative number of items, so an unsigned integer is a much better match for the kinds of values this method will actually return.

0

精彩评论

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