Javatpoint Logo
Javatpoint Logo

C++ Manipulator ends

C++ manipulator ends function is used to insert a null terminating character on os. The ends manipulator does not take any argument whenever it is invoked. It causes a null character to the output.

It is similar to '\0' or charT() in C++.

Syntax

Parameter

os: Output stream object where character is inserted.

Return value

It returns argument os.

Data Races

Modifies the stream object os.

If we try to concurrent access to the same stream object then it may cause data races, except for the standard stream objects cerr, cout, wcout, clog, wcerr and wclog when these are synchronized with stdio.

Exceptions

Object os is in a valid state, if any exception is thrown.

Example 1

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

Output:

ab c

Example 2

Let's see another simple example:

Output:

Enter two Floating Values: 100 200
The Average of the two Numbers is : 150

Example 3

Let's see another simple example:

Output:

"  number = 231 "
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