C++ Manipulator endsC++ 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++. SyntaxParameteros: Output stream object where character is inserted. Return valueIt returns argument os. Data RacesModifies 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. ExceptionsObject os is in a valid state, if any exception is thrown. Example 1Let's see the simple example to demonstrate the use of ends: Output: ab c Example 2Let's see another simple example: Output: Enter two Floating Values: 100 200 The Average of the two Numbers is : 150 Example 3Let's see another simple example: Output: " number = 231 "
Next TopicC++ Manipulator
|