Javatpoint Logo
Javatpoint Logo

C++ Manipulator showpoint

C++ 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.

Syntax

Parameter

str: stream object whose format flag is affected.

Return value

It returns argument str.

Data Races

Data races may be occurred when modified str concurrent accesses to the same stream object.

Exceptions

str is in a valid state, if an exception is thrown.

Example 1

Let's see the simple example to demonstrate the use of showpoint:

Output:

1.0 with showpoint: 1.00000
1.0 with noshowpoint: 1

Example 2

Let's see another simple example:

Output:

30.000	10000.	3.1416
30	10000	3.1416

Example 3

Let'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





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA