Javatpoint Logo
Javatpoint Logo

C++ Manipulator noskipws

C++ manipulator noskipws() function is used to clear the skipws format flag for the str stream.

When we set noskipws format flag, then it does not skip any number of whitespaces before the next input. Tab spaces, blank spaces and carriage returns are considered whitespaces. It will consider any whitespace as part of the next input field.

This applies to any formatted input operation performed with operator >> on the stream.

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 noskipws:

Output:

123
  1

Example 2

Let's see another simple example:

Output:

Default behavior: First Name = G, Middle Name = B, Last Name = S
noskipws behavior: First Name = G, Middle Name =  , Last Name = B

Example 3

Let's see another simple example:

Output:

Default behavior: c1 = a c2 = b c3 = c
noskipws behavior: c1 = a c2 =   c3 = b
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