Friday 10 August 2012

Function String to Unsigned long long int (C/C++ code))

typedef unsigned long long      u64;
typedef unsigned char              u8;

bool String_to_Long_Int (u8 *str, int len, u64 *pNumber)
{
    u64 number = 0;
    if(len <= 0)
        return FALSE;
    while(len--)
    {
        u8 ch = *str++;
        if( (ch < '0') || (ch > '9') )
            return false;
        number = (number*10+(ch-'0'));
    }
    *pNumber= number;
    return true;
}

1 comment:

  1. Playtech Casino | €500 Bonus + 100 FS - Casino Roll
    Looking for a reliable 1xbet casino 꽁머니 지급 to play with? At Casino Roll, you can experience casino 온라인 슬롯 사이트 games from sbobet the comfort of your own home or 가상 화폐 추천 anywhere!

    ReplyDelete