0

这些格式说明符的含义是什么?

%hd %hhd %ld %lld
4

3 回答 3

9

%hd 用于short integerunsigned short integer

%hhd 用于short short integerunsigned short short integer

%ld 用于long integerunsigned long integer

%lld 用于long long integerunsigned long long integer

就那么简单。

这里h, hh, l,ll只是 %d 中的长度修饰符

来源:http: //developer.apple.com/library/ios/#documentation/cocoa/conceptual/Strings/Articles/formatSpecifiers.html

于 2013-07-25T10:00:53.557 回答
3

Just look into the Documentation from Apple provided here: http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/Strings/Articles/formatSpecifiers.html

于 2013-07-25T09:55:16.750 回答
1

我认为IBM 的这份文档要好一些。所以:

  %hd       int x          (short)x           10     1
  %ld       long x         (long)x            10     1
于 2013-07-25T09:57:17.943 回答