Set fill() for string output : cout fill « Console « C++






Set fill() for string output

  
#include <iostream>

using namespace std;

int main()
{
  cout << "Hello" << endl;

  // Now set the width and the fill character.
  cout.width(10);
  cout.fill('*');
  cout << "Hello" << endl;


  return 0;
}
  
    
  








Related examples in the same category

1.cout fill(): Specify the fill charactercout fill(): Specify the fill character
2.Using fill() and width for string output
3.Using fill() and width setting for string output
4.Using fill() to set filler for extra space
5.Uses ios member functions: setf, ios::hex, ios::basefieldUses ios member functions: setf, ios::hex, ios::basefield