|
楼主 |
发表于 2019-9-28 10:12:13
|
显示全部楼层
对,ChaN老师也有一个,我也补上吧http://elm-chan.org/fsw/strf/xprintf.html
xprintf.zip
(4.19 KB, 下载次数: 30)
- /*----------------------------------------------*/
- /* Formatted string output */
- /*----------------------------------------------*/
- /* xprintf("%d", 1234); "1234"
- xprintf("%6d,%3d%%", -200, 5); " -200, 5%"
- xprintf("%-6u", 100); "100 "
- xprintf("%ld", 12345678); "12345678"
- xprintf("%llu", 0x100000000); "4294967296" <_USE_LONGLONG>
- xprintf("%04x", 0xA3); "00a3"
- xprintf("%08lX", 0x123ABC); "00123ABC"
- xprintf("%016b", 0x550F); "0101010100001111"
- xprintf("%*d", 6, 100); " 100"
- xprintf("%s", "String"); "String"
- xprintf("%-5s", "abc"); "abc "
- xprintf("%5s", "abc"); " abc"
- xprintf("%c", 'a'); "a"
- xprintf("%f", 10.0); <xprintf lacks floating point support. Use regular printf.>
- */
复制代码
|
|