Coupon Accepted Successfully!


Flags Without Bit Fields

The flags described in Table  have no corresponding bit fields. The programs on these functions are illustrated as follows.

Table: Flags without Bit Fields



ios :: showbase

Uses base indicator on output

ios :: showpos

Displays + preceding positive number

ios :: showpoint

Shows trailing decimal point and zeros

ios :: uppercase

Uses capital case for hex output

ios :: skipws

Skips white space on input

ios :: unitbuf

Flushes all streams after insertion

ios :: stdio

Flushes stdout and stderr later insertion

ios :: uppercase

Uses capital characters for scientific and hexadecimal values


Adjusts the stream with C standard input and output


Converts Boolean values to text (“true” or “false”)


3.41 Write a program to use the various settings given in the table.

Explanation: In the above program, the setting ios::showpos displays the + sign before the number 1254. The setting ios::showpoint displays the trailing zeros after the number 1254.524. The setting ios::hex converts the decimal number to hexadecimal. It uses small letters. The setting ios::uppercase displays the hexadecimal number in uppercase.

Test Your Skills Now!
Take a Quiz now
Reviewer Name