Skip to content

Instantly share code, notes, and snippets.

@alex-lx
Created June 18, 2013 01:59
Show Gist options
  • Save alex-lx/5802091 to your computer and use it in GitHub Desktop.
Save alex-lx/5802091 to your computer and use it in GitHub Desktop.
reverce a integer
int reverce_number(int v) {
int rv = 0, remainder;
for (; v != 0; remainder = v % 10, v /= 10, rv = rv * 10 + remainder) /* nothing */;
return rv;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment