Develop

[c] 신기한 atoi함수(www.game79.net)

by hooni posted Apr 23, 2003
?

Shortcut

PrevPrev Article

NextNext Article

ESCClose

Larger Font Smaller Font Up Down Go comment Print
#include <stdio.h>

int myatoi(char *str){
        int result=0;
        int i=0;

        while( str[i] ){
                result = result*10 + str[i] - '0';
                i++;
        }

        return  result;
}

void main(){
        char num[10]="1234";

        printf("%d",myatoi(num));
}