C++ Manipulator setfillC++ manipulator setfill() function is used to specify a different character to fill the unused filed width of the value. This manipulator is declared in header <iomanip>. SyntaxParameterc: The new fill character for the stream. Char_type is the type of the characters used by the stream. Return valueThis function returns an object of unspecified type. The setbase function should only be used as a stream manipulator. Data RacesThe stream object on which it is inserted or extracted is modified and concurrent access to the same stream object may introduce data races. ExceptionsObject is in a valid state, if any exception is thrown. Example 1Let's see the simple example to demonstrate the use of setfill: Output: xxxxxxxx24 Example 2Let's see another simple example: Output: default fill: 42 setfill('*'): ********42 Example 3Let's see another simple example: Output: **200**300 ***200***300 ****200****300 *****200*****300
Next TopicC++ Manipulator
|