当前位置:   article > 正文

C/C++的size_t类型printf如何打印_size_type print打印

size_type print打印

Use the z modifier:

  1. size_t x = ...;
  2. ssize_t y = ...;
  3. printf("%zu\n", x); // prints as unsigned decimal
  4. printf("%zx\n", x); // prints as hex
  5. printf("%zd\n", y); // prints as signed decimal

链接:c - How can one print a size_t variable portably using the printf family? - Stack Overflow

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/197852
推荐阅读
相关标签
  

闽ICP备14008679号