#Use the z modifier:
size_t x;
ssize_t y;
printf("%zu\n", x); // prints as unsigned decimal
printf("%zx\n", x); // prints as hex
printf("%zd\n", y); // prints as signed decimal
C++中 打印size_t 和 ssize_t
最新推荐文章于 2024-01-03 14:04:48 发布
#Use the z modifier:
size_t x;
ssize_t y;
printf("%zu\n", x); // prints as unsigned decimal
printf("%zx\n", x); // prints as hex
printf("%zd\n", y); // prints as signed decimal