我正在查看以下代码:
#include <stdio.h>
#include <inttypes.h>
int main()
{
uint32_t total = 0;
printf("\tTotal: %"PRIu32"\n\n", total);
return total;
}
< p> PRIu32
如何适用于 printf
语法?我的意思是,我可以猜测 Iu32
可能意味着“无符号32位整数”。但是,我不确定 man 3 printf
中找到的哪种形式能够容纳引号外的变量--以及如何将其推广到引号外的其他语句。
gcc
,请尝试使用gcc prog.c -E -P
。此外,像"\tTotal: %" "u" "\n\n"
这样的字符串字面量序列在预编译处理中被合并。 - BLUEPIXY$ gcc progc -E -P test.c
时出现了clang: error: no such file or directory: 'progc'
的错误提示。请问这个命令应该做什么? - Alex