资源:
3358 c.biancheng.net/view/275.htmlc中的cout对象是使用流操作符(也称为格式控件)或成员函数控制的。
1、数据表示控制运算符函数setiosflags (十进制*decios:dec进制octios3360:oct16进制hexios:hex三种进制setbase(b ) b )字符大小写)的nouppercaseios : upper case前缀show base/* noshowbaseios : show base中有符号showpos/* 显示noshowposios3360:showpos格式的booolean浮点控制运算符函数setiosflags (成员函数小数点Showpoint/* noshowpointios 33603360 showpoint科学记数法scientificsetprecision(n ) ) ) ) ) ) ) ) ios:scientific通常小数位数setprecision ) n ) precision ) n ) 3,格式控制运算符函数setiosflags ) n填充字符setfill fill左对齐left IOs :左对齐* rightios:right两端对齐internal IOs :输入内部时跳过空格*skipws/noskipws4,格式接口运算符函数setiosflags (成员resetiosflags ) flag ) SETF ) flag )/unsetf ) flag )更新所有流ios:unitbuf的setiosflags ) |中可以连接多个运算符进行设置的固定和sced