Create custom output format : cout custom « Console « C++
- C++
- Console
- cout custom
Create custom output format

#include <iostream>
using namespace std;
ostream &setup(ostream &stream)
{
stream.width(10);
stream.precision(4);
stream.fill('*');
return stream;
}
int main()
{
cout << setup << 123.123456;
return 0;
}
Related examples in the same category