is there a easy way to reset all flags of ios?
Like to change back the fill('*') to a whitespace and change the width(10) back to default?
I simply want to reset the whole thing.
Quote:Original post by deadimpyep, i know this function, but with it i have to use it for every single flag i want to clear. Well ok.
Here's a link on C++ I/O.
My money is on the function "unsetf()".
You could use copyfmt() with a fresh stream object, but that's probably overkill.
Or you might use boost's IO state saver to save and then restore the stream state.
Or you might use boost's IO state saver to save and then restore the stream state.
Quote:Original post by Jonus
I simply want to reset the whole thing.
I assume you mean format flags and not stream state flags you could do:
std::ios_base::fmtflags original_flags = my_stream.flags();// ... set format flags ...my_stream.flags(original_flags); // reset them back to default.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement