hi,
please post the code for the atoi (asciitointeger )
urgent please..
thanks
please post the code for the atoi (asciitointeger )
urgent please..
thanks
char* s="-99909zsddfasd"; int num=0,flag=0; for(int i=0;i<=strlen(s);i++) { if(s[i] >= '0' && s[i] <= '9') num = num * 10 + s[i] -'0'; else if(s[0] == '-' && i==0) flag =1; else break; } if(flag == 1) num = num * -1; printf("%d",num);
Comment