在接下来的页面中,我发现了这样的代码
CERT INT15-C Use intmax_t or uintmax_t for formatted IO on programmer-defined integer types
uintmax_t temp;
if(scanf("%ju", &temp) != 1) {
...
我不熟悉“%ju”说明符。而且我在网上也没有成功找到“%ju”的解释。
这是由某些特定的编译器环境定义的,还是通常使用的编译器环境定义的?
最佳答案
%ju
只是带有 j
长度修饰符的 %u
(无符号)格式,后者在 C99 标准中定义为:
j
— Specifies that a followingd
,i
,o
,u
,x
,X
, orn
conversion specifier applies to an argument with type pointer tointmax_t
oruintmax_t
.
关于转换说明符 %ju,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20364486/