Skip to content

Instantly share code, notes, and snippets.

@Rahajustone
Created March 14, 2014 19:31
Show Gist options
  • Save Rahajustone/9555027 to your computer and use it in GitHub Desktop.
Save Rahajustone/9555027 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int atoi(const char* str)
{
int i,n;
n=0;
for(i=0;str[i]>='0'&&str[i]>='0';++i)
n=10*n+(str[i]-'0');
return n;
}
int main(void)
{
int a;
char* s;
s="A";
a=atoi(s);
printf("%d",a);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment