Tag Archives | string

C++ zero padded string from int

Using an output string stream is a handy way to convert a number to a string. However, what if you want to zero pad the number. Well, that’s where iomanip comes in handy. [code language="cpp"] #include <iomanip> // for setw, setfill #include <iostream> // for cout #include <sstream> // for ostringstream #include <string> // for [...]

Continue Reading 0