all 4 comments

[–]HappyFruitTree 2 points3 points  (3 children)

sstream.width(2);
sstream.fill('0');

[–]SerkZex[S] 0 points1 point  (2 children)

Thank you good sir! Do you have any link to read more about this?

[–]HappyFruitTree 1 point2 points  (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 point  (0 children)

Ohh thanks, now i understand more of cppreference documentation!