How to print a int64_t type in C

For int64_t type: for uint64_t type: you can also use PRIx64 to print in hexadecimal. cppreference.com has a full listing of available macros for all types including intptr_t (PRIxPTR). There are separate macros for scanf, like SCNd64. A typical definition of PRIu16 would be “hu”, so implicit string-constant concatenation happens at compile time. For your code to be fully portable, you must use PRId32 and so on for … Read more