How should I print types like off_t and size_t?
I'm trying to print types like off_t and size_t . What is the correct placeholder for printf() that is portable ? Or is there a completely different way to print those variables? You can use z for size_t and t for ptrdiff_t like in printf("%zu %td", size, ptrdiff); But my manpage says some older library used a different character than z and discourages use of it. Nevertheless, it's standardized (by the C99 standard). For those intmax_t and int8_t of stdint.h and so on, there are macros you can use, like another answer said: printf("value: %" PRId32, some_int32_t); printf("value: %" PRIu16,