首页 > 其他分享 >printf函数size_t的替换字符串zu

printf函数size_t的替换字符串zu

时间:2022-11-04 14:47:44浏览次数:60  
标签:prints decimal printf 字符串 zu size

参考:
https://stackoverflow.com/questions/2524611/how-can-one-print-a-size-t-variable-portably-using-the-printf-family

size_t x = 111;
ssize_t y = -222;
printf("%zu\n", x);  // prints as unsigned decimal
printf("%zx\n", x);  // prints as hex
printf("%zd\n", y);  // prints as signed decimal

标签:prints,decimal,printf,字符串,zu,size
From: https://www.cnblogs.com/tangjicheng/p/16857703.html

相关文章