I have a variable of type size_t
, and I want to print it using printf()
. What format specifier do I use to print it portably?
In 32-bit ma
On some platforms and for some types there are specific printf conversion specifiers available, but sometimes one has to resort to casting to larger types.
I've documented this tricky issue here, with example code: http://www.pixelbeat.org/programming/gcc/int_types/ and update it periodically with info on new platforms and types.