I\'ve seen examples of this all over the place:
int i = 2; char c = i + \'0\'; string s; s += char(i + \'0\');
However, I have not yet seen
If you look at the ASCII table, asciitable, you'll see that the digits start at 48 (being '0') and go up to 57 (for '9'). So in order to get the character code for a digit, you can add that digit to the character code of '0'.