Javatpoint Logo
Javatpoint Logo

C++ Manipulator internal

C++ manipulator internal function is used to set the adjustfield format flag for the str stream to internal.

When we set adjustfiled to internal, the output is padded to the field width by inserting fill characters at a specified internal point, for which numerical values is between the sign and/or numerical base and the number magnitude. It is equivalent to right for non-numerical values.

Syntax

Parameter

str: stream object whose format flag is affected.

Return value

It returns argument str.

Data Races

Data races may cause when modifies str concurrent access 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 internal manipulator:

Output:

-   24
-24   
   -24

Example 2

Let's see another simple example:

Output:

..-123.456
-..123.456

Example 3

Let's see another simple example:

Output:

Left fill:
-1.23*******
0x2a********
USD *1.23***

Internal fill:
-*******1.23
0x********2a
USD ****1.23

Right fill:
*******-1.23
********0x2a
***USD *1.23
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