摘要
C++程序的调试一般有调试器、printf、日志文件三种。...class str_format_t 是用来格式化字符串的工具类,它使用sprintf的格式化语法,但是额外提供了排错和纠错功能:
l 使用sprintf格式化语法,最基本的格式化参数都支持如%d,%u...,%ld,%lu,%s,%c,%x,%p,%f甚至形如%04d设置字符串宽度的语法也是支持的
l str_format_t 类型安全,格式化参数支持整型、浮点数、字符串cost char*、指针、string...l str_format_t 拥有自动纠错功能,使用sprintf的时候除了类型不安全导致出错外,最常见的就是sprintf的格式化参数与赋值的参数个数不一致,如sprintf(buff, “%s,%s...支持多种格式化 %c %s, %d, %ld, %u, %lu, %x, %X, 找到格式化的类型
//for (++cur_format_index; cur_format_index