CPP/IO/Setw

From ProgrammingExamples
< CPP
Revision as of 08:09, 23 June 2010 by Daviddoria (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Setw.cpp

#include <iostream>
#include <iomanip>
 
using namespace std;
 
int main(int argc, char* argv[])
{
  cout << "d: " << setw(15) << 5.42 << endl;
  cout << setw(4) << "d: " << setw(15) << 5.1 << endl;
 
  return 0;
}