Created
May 22, 2013 23:20
-
-
Save aji/5631713 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned int numeric_atoi(const char *s) | |
{ | |
return ((s[0] - '0') * 100) | |
+ ((s[1] - '0') * 10) | |
+ ((s[2] - '0')); | |
} |
Author
aji
commented
May 22, 2013
If you're pretty sure multiple evaluation of s
is okay.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment