Yes, this syntax is correct (at least for C99). It looks like your compiler is not configured to handle it. Just pull out z and you will probably be fine. To be true, make sure your printf format specifiers match the size of the types. Including all the warnings your compiler will give you will probably help in this regard.
Your quote:
The z prefix must be used to print it, since the actual size may vary for each architecture.
refers to the fact that size_t (which is the type returned by the sizeof operator) can vary from architecture to architecture. z designed to make your code more portable. However, if your compiler does not support it, this will not work. Just play with the combinations %u , %lu , etc., until you get the point that makes sense.
Carl Norum
source share