Just FYI, if you want more than single digit numbers you can use sprintf:
char txt[16];
int myNum = 20;
sprintf(txt, "%d", myNum);
Then the first digit is in a char at txt[0], and so on.
(This is the C approach, not the C++ approach. The C++ way would be to use stringstreams.)