char letter; letter = static_cast('a' + 4);
IntDigitToHex(int digit) { char value; if (digit <= 10) { value = static_cast<char> (static_cast<int>('0') + digit); } else { value = static_cast<char> (static_cast<int>('A') + digit-10); } return value; }