C printf格式化输出 的跨平台

printf()在不同的系统上,占位符的可能有不同的写法,如:

%ld:long int, 32位平台4 bytes

%lld: long long int, 32位平台8 bytes

 

可以考虑使用 #include <inttypes.h> 头文件来做跨平台处理。

 

 

posted @ 2019-08-28 16:41  hunterDing  阅读(422)  评论(0编辑  收藏  举报