C++ Manipulator noboolalphaC++ manipulator noboolalpha function is used to set the output stream to display bool values as integers 0 or 1 (i.e. the default setting). SyntaxParameterstr: stream object whose format flag is affected. Return valueIt returns argument str. Data RacesData races may be occurred when modified str concurrent accesses to the same stream object. Exceptionsstr is in a valid state, if an exception is thrown. Example 1Let's see the simple example to demonstrate the use of noboolalpha: Output: When we use boolalpha then b = true When we use noboolalpha then b = 1 Example 2Let's see another simple example: Output: boolalpha true: true boolalpha false: false noboolalpha true: 1 noboolalpha false: 0 "true false" parsed as 1 0 Example 3Let's see another simple example: Output: booleanValue is 1 booleanValue (after using boolalpha) is true switch booleanValue and use noboolalpha booleanValue is 0 booleanValue (after using boolalpha) is false
Next TopicC++ Manipulator
|