Is the %zu specifier required for printf?
If size_t exists shouldn't zu also be available in printf?
size_t
existed at least since C89 but the respective format specifier %zu
(specifically the length modifier z
) was added to the standard only since C99.
So, if you can't use C99 (or C11) and had to print size_t
in C89, you just have to fallback to other existing types, such as:
printf("%lu\n", (unsigned long)n);