Dan*_* M. 3 c printf typedef stdint
问题是在一个平台上(windows,mvsc2015)uint64_t被定义为unsigned long long另一个平台(ubuntu,clang),unsigned long并且有代码看起来像 sprintf(buffer, "%#llx", u64key);
uint64_t
unsigned long long
unsigned long
sprintf(buffer, "%#llx", u64key);
Pas*_*uoq 10
解决方案是使用C99的格式宏,特别是PRIu64对于uint64_t:
PRIu64
#include <inttypes.h> … sprintf(buffer, "%#" PRIu64 "\n", u64key);
归档时间:
10 年,4 月 前
查看次数:
125 次
最近记录: