C++ Manipulator showpointC++ manipulator showpoint function is used to set the showpoint format flag for the str stream. When we use showpoint format flag, the decimal point is always written for floating point values inserted into the stream even for those whose decimal part is zero. 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 showpoint: 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: Precision set to 2: 192.99 168.00 3.14 Precision set to 4: 192.9864 168.0000 3.1416 Precision set to 6: 192.986400 168.000000 3.141590
Next TopicC++ Manipulator
|