remove digit of an integer from left to right

hello, I'm trying to write a code that would remove the digit of an integer from left to right. For example, 123 to 23 then 3 or 3202 to 202.
 
   n = n % (int) pow(10, (int) log10(n));

this is an equation that I been trying but it doesn't seem to work. Any help?
1
2
3
4
5
unsigned int remove_left_most_digit( unsigned int n )
{
    if( n < 10 ) return 0 ; // chop of the last digit
    else return remove_left_most_digit( n/10 ) * 10 + n%10 ;
}

http://coliru.stacked-crooked.com/a/81e60d9b5fedd8e3
Topic archived. No new replies allowed.