I'm having trouble getting the individual digits of a number.
For example:
say you have simple integer variable containing 1234. How do you get the individual digits of the number, like 1, 2, 3, and 4 individually?
It should be somthing like this.
Code:
int number = 1234;
get the digits()
{
int[4] digits;
digits[0] = the first digit of [int number].
digits[1] = the second digit of [int number].
digits[2] = the third digit of [int number].
etc...
}
/* the end result should be:
digits[0] = 1;
digits[1] = 2;
digits[2] = 3;
digits[3] = 4;
*/
Is this possible?
Thanks in advanced.