Correct printf format specifier for size_t: %zu or %Iu?

后端 未结 4 1623
不知归路
不知归路 2020-11-29 08:02

I want to print out the value of a size_t variable using printf in C++ using Microsoft Visual Studio 2010 (I want to use printf instea

4条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 08:22

    Microsoft's C compiler does not catch up with the latest C standards. It's basically a C89 compiler with some cherry-picked features from C99 (e.g. long long). So, there should be no surprise that something isn't supported (%zu appeared in C99).

提交回复
热议问题