Mega Code Archive

 
Categories / C++ Tutorial / Development
 

Create an output manipulator

#include <iostream>  #include <iomanip>  using namespace std;    ostream &mySetting(ostream &stream)  {    stream.setf(ios::left);    stream << setw(10) << setfill('$');    return stream;  }    int main()  {    cout << 10 << " " << mySetting << 10;      return 0;  } 10 10$$$$$$$$