C++ Manipulator noshowposC++ manipulator noshowpos function is used to clear the showpos format flag for the str stream. When we set noshowpos format flag, then it disables the display of the '+' sign in non-negative integer (including zero) output. SyntaxParameterstr: stream object whose format flag is affected. Return valueIt returns argument str. Data RacesData races may cause when modifies str concurrent access to the same stream object. no Exceptionsstr is in a valid state, if an exception is thrown. Example 1Let's see the simple example to demonstrate the use of noshowpos: Output: +1 +0 -1 1 0 -1 Example 2Let's see another simple example: Output: +75 75 Example 3Let's see another simple example: Output: Enter Number: 24 +24 24
Next TopicC++ Manipulator
|