With printf()
, I can use %hhu
for unsigned char
, %hi
for a short int
, %zu
for a size_t
Until C99, bool was not apart of standard C, and thus did not exist as a printf modifier. C99, defined _Bool (which you are using) to be an integer, thus you should be fine casting it as an integer to display (at least from a machine perspective). Alternatively, you could do something like:
printf("%d",foo?1:0);