C++ Manipulator noshowpointC++ manipulator noshowpoint function is used to clear the showpoint format flag for the str stream. When we not set showpoint format flag, the decimal point is only written when necessary for floating point values inserted into the stream; when their decimal point is not zero. SyntaxParameterstr: stream object whose format flag is affected. Return valueIt returns argument str. Data RacesData races may occur 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 noshowpoint: Output: 1.0 with showpoint: 1.00000 1.0 with noshowpoint: 1 Example 2Let's see another simple example: Output: 30.000 10000. 3.1416 30 10000 3.1416 Example 3Let's see another simple example: Output: Enter your percent : 79.8 Percent with showpoint: 79.8000 Percent with noshowpoint: 79.8
Next TopicC++ Manipulator
|