Andrea Viscovich wrote:
>
> >atol would not work if the string is in HEX.
>
> Well, the code from Nisan worked fine with my smsc connection,
> and I implemented this for atoll.
> Maybe under more recent cygwin it's built in.
>
> long long atoll(char *str){
> long long result = 0;
> int negative=0;
>
> while (*str == ' ' || *str == '\t')
> str++;
> if (*str == '+')
> str++;
> else if (*str == '-') {
> negative = 1;
> str++;
> }
>
> while (*str >= '0' && *str <= '9') {
> result = (result*10) - (*str++ - '0');
> }
>
> return negative ? result : -result;
> }
hmmm, so atoll() is not posix compliant?! at least it's *not* included
in the standard headers on Cygwin 1.3.22. :((
Nisan, isn't there a portable function to use in this case?
Stipe
[EMAIL PROTECTED]
-------------------------------------------------------------------
Wapme Systems AG
Vogelsanger Weg 80
40470 D�sseldorf
Tel: +49-211-74845-0
Fax: +49-211-74845-299
E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are