I\'m trying to find the nth digit of an integer of an arbitrary length. I was going to convert the integer to a string and use the character at index n...
n
number = 123456789 n = 5 tmp1 = (int)(number / 10^n); // tmp1 = 12345 tmp2 = ((int)(tmp1/10))*10; // tmp2 = 12340 digit = tmp1 - tmp2; // digit = 5