Why doesn’t PRIu64 work in this code?

In C++ the macros are not automatically defined just by including the file.

You need to add the following:

#define __STDC_FORMAT_MACROS 1

before

#include <inttypes.h>

How to printf uint64_t? Fails with: “spurious trailing ‘%’ in format”

Leave a Comment