C: printf 中的 ptrdiff_t 应该使用哪个字符? [英] C: Which character should be used for ptrdiff_t in printf?
本文介绍了C: printf 中的 ptrdiff_t 应该使用哪个字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
printf
中的ptrdiff_t
应该使用哪个字符?
Which character should be used for ptrdiff_t
in printf
?
C标准是否清楚地解释了如何在printf
中打印ptrdiff_t
?我还没找到.
Does C standard clearly explains how to print ptrdiff_t
in printf
? I haven't found any one.
int a = 1;
int b = 2;
int* pa = &a;
int* pb = &b;
ptrdiff_t diff = b - a;
printf("diff = %?", diff); // % what?
推荐答案
它是 %td
.请参阅此处.
这篇关于C: printf 中的 ptrdiff_t 应该使用哪个字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文