When attempting to print a uint64_t using the printf function, you may encounter the error message "spurious trailing '%' in format". This error is caused by a trailing percent sign (%) in the format string provided to printf. To resolve this issue, follow these steps:
#define __STDC_FORMAT_MACROS #include <inttypes.h>
uint64_t ui64 = 90; printf("test uint64_t : %" PRIu64 "\n", ui64);
By following these steps, you can correctly print a uint64_t value using printf without encountering the "spurious trailing '%' in format" error.
The above is the detailed content of How To Print a uint64_t Value Using printf Without the 'spurious trailing '%' in format' Error?. For more information, please follow other related articles on the PHP Chinese website!