is it possible to add a character and not a number to a int? so something like x = 1 and a 1 would give me 11 and not 2.
Printable View
is it possible to add a character and not a number to a int? so something like x = 1 and a 1 would give me 11 and not 2.
Yes:
Assuming Digit is in the range 0 - 9.Code:int AddDigitToNumber(int Number, int Digit)
{
return ((Number * 10) + Digit);
}