stringstream ss; ss << setfill('0') << setw(10) << i; vstrImageFilenames[i] = strPrefixLeft + ss.str() + ".png";