iomanip setw() function in C++ with Examples
The setw() method of iomanip library in C++ is used to set the ios library field width based on the width specified as the parameter to this method.
Parameters: This method accepts n as a parameter which is the integer argument corresponding to which the field width is to be set.
Return Value: This method does not returns anything. It only acts as stream manipulators.
Before setting the width: 50 Setting the width using setw to 5: 50
Before setting the width: 50 Setting the width using setw to 10: 50