I have some numbers of different length (like 1, 999, 76492, so on) and I want to convert them all to strings with a common length (for example, if the length is 6, then tho
stringstream will do (as xtofl pointed out). Boost format is a more convenient replacement for snprintf.