I have a keypad that I use to enter digits into a microcontroller (atmega32 avr). The user will be able to enter 1, 2 or 3 digits, because I defined the input range will be [0-999]. Each of those digits will be stored in a position of an array of integers.
So, if my array is defined as int d[3]
and the user enters, in sequence, 2, 6, 9, I'll have d[0] == 2
, d[1] == 6
and d[2] == 9
. Now I want to make an integer from those digits {2, 6, 9}
: value == 269
. How can I do that?