How to printf a 64-bit integer as hex? [duplicate]

The warning from your compiler is telling you that your format specifier doesn’t match the data type you’re passing to it.

Try using %lx or %llx. For more portability, include inttypes.h and use the PRIx64 macro.

For example: printf("val = 0x%" PRIx64 "\n", val); (note that it’s string concatenation)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)