当前位置:   article > 正文

C++打印size_t和ssize_t和int64_t和uint64_t(十四)_size_t打印

size_t打印

1.代码示例  

  1. 1.main.c
  2. //定义:typedef unsigned int size_t;
  3. typedef unsigned int uint32_t;
  4. typedef signed int ssize_t;
  5. int main(){
  6. size_t a;
  7. ssize_t b;
  8. int64_t c;
  9. uint64_t d;
  10. unint32_t e;
  11. printf("a = %zu \n", a); // size_t <----> unsigned int
  12. printf("a = %zu \n", e); // uint32_t <----> unsigned int
  13. printf("b = %zd \n", b); // ssize_t <---> signed int
  14. printf("c = %jd \n", c); // int64_t <---> long long
  15. printf("d = %ju \n", d; // uint64_t <---> unsigned long long
  16. }
  17. *********************************************************
  18. typedef signed char int8_t;
  19. typedef short int16_t;
  20. typedef int int32_t;
  21. typedef long long int64_t;
  22. /*Unsigned*/
  23. typedef unsigned char uint8_t;
  24. typedef unsigned short uint16_t;
  25. typedef unsigned int uint32_t;
  26. typedef unsigned long long uint64_t;
  27. *********************************************************

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

闽ICP备14008679号