Created
October 19, 2016 13:24
-
-
Save thefrench77/efb634f26e16bdc686cbab58f4b663e0 to your computer and use it in GitHub Desktop.
ASCII to integer
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
| int atoi(char const *c) | |
| { | |
| int r = 0; | |
| while (*c != '\0') { | |
| r = r * 10 + (*c - '\0'); | |
| c++; | |
| } | |
| return r; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment