C/C++:uint64_t 转为char*

版权声明:本文为博主原创文章,转载请注明出处。 https://blog.csdn.net/qq_29542611/article/details/84595208

碰到个打印uint64_t的情况,找了会,也碰到点问题。做个记录。
需要添加 头文件

#define __STDC_FORMAT_MACROS 1 //一定要写在 下面这个include的上面
#include <inttypes.h>

使用的地方

	char buf[256] = {0};
    snprintf(heightStr, sizeof buf, "%" PRIu64, height);

猜你喜欢

转载自blog.csdn.net/qq_29542611/article/details/84595208