How to format text using std:out setfill std::setw std:right with one padding space
问题 I just want to format a string and an integer value with right justify. There is no problem to do this without leading space before the integer value. bytes.....................123981 total bytes..............1030131 But it should look like this: bytes ................... 123981 total bytes ............ 1030131 Unfortunately the example below wont work, because setw (right justify) relates only to the next stream element. int iBytes = 123981; int iTotalBytes = 1030131; cout << setfill('.');