Skip to content

Instantly share code, notes, and snippets.

@ikautak
Created February 20, 2013 14:12
Show Gist options
  • Save ikautak/4995791 to your computer and use it in GitHub Desktop.
Save ikautak/4995791 to your computer and use it in GitHub Desktop.
simple atoi implementation.
int simple_atoi(const char* a) {
int ans = 0;
while (*a != '\0') {
ans = ans * 10 + (*a++) - '0';
}
return ans;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment