Computer Science - Object Oriented Programming Using C++ - Discussion

Discussion Forum : Object Oriented Programming Using C++ - Section 5 (Q.No. 43)
43.
The function that takes arguments to set the bits of cout is _____
setf()
bitset()
ios()
flat()
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
2 comments Page 1 of 1.

Ayesha said:   3 years ago
Please explain the answer.

Ayesha said:   3 years ago
Bitset()

Bitset represents a fixed-size sequence of N bits and stores values either 0 or 1. Zero means value is false or bit is unset and one means value is true or bit is set. Bitset class provides constructors to create bitset from integer as well as from strings. The size of the bitset is fixed at compile time.

setf()

We can use the setf() function to configure formatting for the cout object. We pass the setf() function arguments made up of ios_base class constants such as ios_base::boolalpha to display bool values as true or false instead of 1 or 0, and ios_base::showpoint to show a trailing decimal point.

Post your comments here:

Your comments will be displayed after verification.