setfill
[manipulator]
template <class charT>
  smanip setfill ( charT
c );
<iomanip>
  cplusplus.com  

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.

Parameters.

c
Character to be used as fill character.

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

Example.

// 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:
 xxxxxxxx77

See also.
  setw
  iomanip manipulators


© The C++ Resources Network, 2001