Oct 30, 2002 #1 marie325 Technical User Joined Oct 30, 2002 Messages 1 Location US How can I capture the current setfill char before I change it so I can change it back before my function ends?
How can I capture the current setfill char before I change it so I can change it back before my function ends?
Nov 1, 2002 #2 xwb Programmer Joined Jul 11, 2002 Messages 6,828 Location GB 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. Upvote 0 Downvote
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.
Nov 2, 2002 #3 chipperMDW Programmer Joined Mar 24, 2002 Messages 1,268 Location US 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 http://www.boost.org. They have some state saver classes already written. Upvote 0 Downvote
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 http://www.boost.org. They have some state saver classes already written.