赞
踩
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 - How can one print a size_t variable portably using the printf family? - Stack Overflow
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。