1.

What Are Formatting Flags In Ios Class?

Answer»

Answer :The ios class contains formatting flags that help users to format the stream data. Formatting flags are a set of enum definitions. There are two types of formatting flags:On/Off flagsFlags that work in-group The On/Off flags are turned on using the setf( ) function and are turned off using the unsetf( )function. To set the On/Off flags, the one ARGUMENT setf( ) function is used. The flags working in groups are set through the two-argument setf( ) function. For EXAMPLE, to left justify a string we can set the flag as, cout.setf ( ios::left ); cout << "KICIT NAGPUR"; To remove the left JUSTIFICATION for subsequent output we can say, cout.unsetf ( ios::left ); The flags that can be set/unset include SKIPWS, showbase, showpoint, uppercase, showpos, unitbufand stdio. The flags that work in a group can have only one of these flags set at a time.



Discussion

No Comment Found