相关代码 |
|
#include void showflags(void); void main(void) { showflags(); long f = ios::showpos | ios::showbase | ios::oct | ios::right; cout.flags(f); 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 }
相关资源 |
|