I've been in the habit of using '%lld' and '%zu' to print 'long long' and 'size_t' respectively. However, the windows world needs '%I64d' and '%Iu' instead. It would be nice to have compatibility macros for this.
stdint.h/inttypes.h has a convention for this for the standard fixed width types. eg. PRIx32 for 'uint32_t'. This is used like:
I've been in the habit of using '%lld' and '%zu' to print 'long long' and 'size_t' respectively. However, the windows world needs '%I64d' and '%Iu' instead. It would be nice to have compatibility macros for this.
stdint.h/inttypes.h has a convention for this for the standard fixed width types. eg. PRIx32 for 'uint32_t'. This is used like:
> printf( "%"PRIx32" \n", (uint32_t)42);
http:// en.cppreference .com/w/ c/types/ integer