showpos function — Manipulator to show plus sign for nonnegative numbers
ios_base& showpos(ios_base& stream)
The showpos
function is a
manipulator that sets the showpos
flag, which tells an output stream to write a plus (+
) sign, even if the sign is unnecessary
(the value is 0
or positive).
Specifically, the function calls stream.setf(ios_base::showpos)
and returns
stream
.