How can I find the Nth digit? [closed]
- by kokkch
Possible Duplicate:
How to get the Nth digit of an integer with bit-wise operations?
I spent more than one day trying to solve this problem but I couldn't find a solution.
I have a function named get_nth_digit(int x, int pos);.
int x is a number given by the user, int pos is the number that represents the position of the digit in the number x the user wants to get.
How can I do this? Can anyone help?