About 51 results
Open links in new tab
  1. Correct printf format specifier for size_t: %zu or %Iu?

    Mar 25, 2013 · MS Visual Studio didn't support %zu printf specifier before VS2013. Starting from VS2015 (e.g. _MSC_VER >= 1900) %zu is available. As an alternative, for previous versions of …

  2. c - Is the %zu specifier required for printf? - Stack Overflow

    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 …

  3. Is using %zu correct syntax in a printf format string as shown in some ...

    Is using %zu correct syntax in a printf format string as shown in some C code found on Wikipedia? Ask Question Asked 15 years, 9 months ago Modified 5 months ago

  4. printf - Difference between %zu and %lu in C - Stack Overflow

    Jul 29, 2022 · What is the difference between %zu and %lu in string formatting in C? %lu is used for unsigned long values and %zu is used for size_t values, but in practice, size_t is just an unsigned long.

  5. How to get MinGW GCC to recognize the %zu format specifier for size_t?

    Aug 23, 2021 · Apparently %zu is handled as not supported, which might not be necessarily true. (A quick check with MinGW64's GCC 8.1.0 on Windows 10 shows the warning, but works.) However, …

  6. c - %zu format specifier with C99 not working - Stack Overflow

    Aug 4, 2023 · I'm willing to print a size_t value using the %zu format specifier in my format string, however, I always get "zu" as an output, rather than the actual value in my size_t …

  7. c - How to use "zd" specifier with `printf ()`? - Stack Overflow

    Oct 3, 2015 · void print_size(size_t sz) { printf("%zu\n", sz); } The C spec seems to allow printf("%zd\n", sz) depending on how it is read: 7.21.6.1 The fprintf function z Specifies that a following d, i, o, u, x, …

  8. Newest Questions - Stack Overflow

    2 days ago · Stack Overflow | The World’s Largest Online Community for Developers

  9. Platform independent size_t Format specifiers in c?

    Jan 24, 2010 · I want to print out a variable of type size_t in C but it appears that size_t is aliased to different variable types on different architectures. For example, on one machine (64-bit) the following …

  10. What's the correct way to use printf to print a size_t?

    size_t is defined as an unsigned integer, but the size of it depends on whether you're on a 32- or 64-bit machine. What's a correct and portable way to print out a size_t?