setf() and flags()

Hello, I wonder what the difference is with these functions.

setf() - fmtflags setf(fmtflags flags) - says the function returns previous settings of flags and turns on the flags specified by flags

but i do no see much differ from the flags function which says

fmtflags flags(fmtflags flags) - sets the flag value to that specified by flags and returns the previous flag value

I do not understand the difference. I see one video and the person say the difference is flags() can take many parameters. Is this only difference?
The one-parameter version of setf sets but does not unset flags.
The two parameter version replaces the masked flags.

flags replaces the current flags; it behaves like
stream.setf(flags, ~0);

If this doesn't make any sense, study bitfields.
I think I understood. So if i used setf() i could set many different flags on different lines of code. But if i used flags() it would replace the previous flag set each time it was called.
Yeah, you got it.
Great, thank you for help.
Topic archived. No new replies allowed.