C++ Manipulator rightC++ manipulator right function is used to set the adjustfield format flag for the str stream to right. When we set adjustfiled to right, the output is padded to the field width by inserting fill characters at the beginning, effectively adjusting the field to the right. SyntaxParameterstr: stream object whose format flag is affected. Return valueIt returns argument str. Data RacesData races may cause when modifies str concurrent access to the same stream object. Exceptionsstr is in a valid state, if an exception is thrown. Example 1Let's see the simple example to demonstrate the use of right manipulator: Output: - 24 -24 -24 Example 2Let's see another simple example: Output: 5 5 5 5 5 5 Example 3Let'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 TopicJava Float valueOf() Method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India