Topic: HELP! with streams


Author: wchong@corpcon1.ml.com (William Chong)
Date: Wed, 28 Dec 1994 16:59:54 GMT
Raw View
I hope this is the right group to post to.  I'm having a problem
with justification in streams.  I have noticed that I CANNOT
left-justify an int, right-justify a double, or right-justify
a string.

That is, the following does not work....

cout << setw(10) << setiosflags(ios::left) << 8 << endl
cout << setw(10) << setiosflags(ios::right) << 7.125 << endl
cout << setw(10) << setiosflags(ios::right) << "Test" << endl

Has anyone encountered this problem before?  Is there a reason why
the above does not work for me?  I can think of a few ways
to get around it but does anyone know a simple alternative?

Any help would be appreciated.  Please mail me direct at wchong@ml.com
Thanks.



    Will