相关代码 |
|
#include void showflags(void); void main(void) { showflags(); cout.setf(ios::right | ios::showpoint | ios::fixed); showflags(); } void showflags(void) { long flag_set, i; int j; char flags[15][12] = { "skipws", "left", "right", "internal", "dec", "oct", "hex", "showbase", "showpoint", "uppercase", "showpos", "scientific", "fixed", "unitbuf", }; flag_set = cout.flags(); for (i=1, j=0; i if (i & flag_set) cout else cout cout }