Originally posted by: dighn
cout << setiosflags(ios_base::right) << setw(8) << setfill('0') << yourthing;
oh yeah remember to include <iomanip>
Originally posted by: screw3d
http://www.cplusplus.com/ref/iostream/iomanip/setfill.html
dighn beat me to it 🙂
Originally posted by: Jumpem
Originally posted by: dighn
cout << setiosflags(ios_base::right) << setw(8) << setfill('0') << yourthing;
oh yeah remember to include <iomanip>
Ok, what if I have other hex and string values being output after that. Can I put them in the same cout statement or do I need another one? I guess, what is the scope of setiosflags, setw, and setfill?
Originally posted by: dighn
i'm not totally sure without experimenting with it. i think it persists for at least the whole statement.
Originally posted by: Nik
http://forums.anandtech.com/categories.aspx?catid=33&flcache=8995644&entercat=y