请告诉我C中以下数据类型的格式说明符。
unsigned char,signed char,unsigned int,signed int,unsigned short int,signed int,short int,long int,unsigned long int,signed long int,long long,long double
答案 0 :(得分:0)
以下是我肯定知道的:
unsigned char:%u
(确保输出声明为unsigned char)
前:
unsigned char test = 500;
printf("%u", test);
unsigned int:%u
signed int:%i
或%d
unsigned short int:%hu
可能有用。如果不是:%d
或%u
也应该没问题。
signed int:%d
或%i
short int:%d
long int:%ld
unsigned long int:%lu
签名long int:%ld
(不确定这个)。
多长:%lld
或%llu
如果未签名
long double:%Lf
答案 1 :(得分:0)
<强> RTFM 强>
这就是你要求的: https://msdn.microsoft.com/en-us/library/hf4y5e3w.aspx
这更有用: https://msdn.microsoft.com/en-us/library/56e442dc.aspx