Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with setfill

Status
Not open for further replies.

marie325

Technical User
Oct 30, 2002
1
US
How can I capture the current setfill char before I change it so I can change it back before my function ends?
 
C++ stream manipulation is an absolute pain.

The only way I know of doing this is to write a wrapper for setfill that stores the fill characters so that they can be queried.
 
Or you could call the fill() member function of the stream, which returns the current fill character.

If you're going to be doing a lot of saving the states of your iostreams, I'd suggest Boost's io library at They have some state saver classes already written.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top