Originally Posted by
Prelude
>And using sprintf/strrev/atoi is a bit overkill, isn't it
Barring atoi because it sucks and defeats the benefit of using strings, no, it isn't overkill. In fact, turning the integer into a string and reversing the string is vastly superior to breaking down and reconstructing the value as an integer. Why? What happens if you want to reverse 1999999999 with 32-bit integers? There are far too many cases like that, where the reversed value can't be represented by the data type.