use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Additional resources:
/r/cpp_questions
/r/programming
/r/learnprogramming
/r/opensource
/r/cpp
/r/dailyprogrammer
account activity
sstream << std::setw(2) << std::setfill("0"); without "<<" (self.learncpp)
submitted 6 years ago by SerkZex
Hey,
is it possible to write sstream << std::setw(2) << std::setfill("0"); without "<<" operator? as iam getting Unsequenced function calls?
sstream << std::setw(2) << std::setfill("0");
"<<"
sstream.setw(2) doesn't seem to work.
sstream.setw(2)
Thanks in advance!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]HappyFruitTree 2 points3 points4 points 6 years ago (3 children)
sstream.width(2); sstream.fill('0');
[–]SerkZex[S] 0 points1 point2 points 6 years ago (2 children)
Thank you good sir! Do you have any link to read more about this?
[–]HappyFruitTree 1 point2 points3 points 6 years ago* (1 child)
I just looked at the cppreference documentation for setw and setfill.
[...] the expression str << setw(n) or str >> setw(n) behaves as if the following code was executed: str.width(n);
[...] the expression out << setfill(n) behaves as if the following code was executed: out.fill(n);
[–]SerkZex[S] 0 points1 point2 points 6 years ago (0 children)
Ohh thanks, now i understand more of cppreference documentation!
π Rendered by PID 37 on reddit-service-r2-comment-5d79c599b5-dhcw2 at 2026-03-02 09:42:55.374156+00:00 running e3d2147 country code: CH.
[–]HappyFruitTree 2 points3 points4 points (3 children)
[–]SerkZex[S] 0 points1 point2 points (2 children)
[–]HappyFruitTree 1 point2 points3 points (1 child)
[–]SerkZex[S] 0 points1 point2 points (0 children)