Using fill() to set filler for extra space : cout fill « Console « C++






Using fill() to set filler for extra space

  
#include <iostream>
using namespace std;
int main()
{
   cout << "Start >";
   cout.width(25);
   cout << 123 << "< End\n";
   cout << "Start >";
   cout.width(25);
   cout.fill('*');
   cout << 123 << "< End\n";
   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.Set fill() for string output
5.Uses ios member functions: setf, ios::hex, ios::basefieldUses ios member functions: setf, ios::hex, ios::basefield