When writing to a stream, setting the width property only lasts to the write of the stream.
For example, if you want to put three 4's in a field width of 20, you would do this:
cout << setw(20) << 4 << setw(20) << 4 << setw(20) << endl;
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment