Mega Code Archive

 
Categories / C++ Tutorial / Data Types
 

Pad the field width with spaces and set the internal and showpos flags

#include <iostream> using namespace std; int main() {   cout << "Hello" << endl;   cout.width(12);   cout.fill(' ');   cout.setf(ios::showpos | ios::internal);   cout << 765.34 << endl;   return 0; }