首页 > TAG信息列表 > imbue

ofstream 输出int类型时候如何去掉千分位分隔符

需要使用locale的功能。 默认的应该是C语言的locale没有千位分隔符的,如果你的程序哪里设置了。参考使用 io流的 imbue方法来切换数字格式。"chs"是中文简体的locale, "C"就是c语言默认的。 locale loc("C"); scorefile.imbue(loc);