/*
    Convert string to int
    By DreamVB
*/
#include <stdio.h>
#include <stdlib.h>

int a2Int(char *s){
    int tmp = 0;
    int neg = 0;

    while(isspace(*s)){
        ++s;
    }

    if(*s == '-'){
        ++s;
        neg = 1;
    }

    if(*s == '+'){
        ++s;
    }

    while(isdigit(*s)){
        tmp = 10 * tmp + *s - '0';
        ++s;
    }

    if(neg){
        tmp = -tmp;
    }

    return tmp;
}

int main()
{
    int num = 0;
    //Convert the string 65535 to a number
    num = a2Int("256");
    //Output the number
    printf("%d\n",num);
    return 0;
}
