While I think @pilcrow's answer - using C99 format string conversion specifiers in <inttypes.h>
- is probably the most elegant, the unsigned long
type is guaranteed to be at least 32 bits, so you could simply use the %lu
specifier with a cast:
printf("%lu\n", (unsigned long) value);
Which doesn't require C99. That's not much of an issue today, but IIRC, APR doesn't assume a C99 compiler either, or they wouldn't have bothered rolling their own 'exact' types.