template <class charT>
  smanip setfill ( charT
c );

Set fill character
  Sets the fill character to the value of parameter c as if a call to stream member fill(c).
  The fill character is used in output insertion operations to fill spaces when padding results to the field width.
  You must include <iomanip> to use this manipulator.


Character to be used as fill character.

Return Value.
  This function should only be used as a stream manipulator.


// setfill example
#include <iostream>
#include <iomanip>
using namespace std;

int main () {
  cout << setfill ('x') << setw (10);
  cout << 77 << endl;
  return 0;
This code uses setfill to set the fill character to 'x'. The output of this example shall be similar to:

See also.
  iomanip manipulators

© The C++ Resources Network, 2001