Name

showpos function — Manipulator to show plus sign for nonnegative numbers

Synopsis

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.

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.