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
A more general approach:
template int nth_digit(int value, int digit) { return (value / (int)pow((double)base, digit)) % base; }
Just lets you do the same thing for different base numbers (e.g. 16, 32, 64, etc.).