[DGD] atoi

Robert Forshaw iouswuoibev at hotmail.com
Tue Feb 3 17:05:37 CET 2004


Does anyone here have a working atoi function in lpc that they can show me? 
I tried making one:

static int atoi(string str)
{
    int count;
    int result;

    for(count = strlen(str) - 1; count < 0; count--)
      {
          if(str[count] < '0' || str[count] > '9')
                continue;

          result +=
            (str[count] - NUMERIC_MODIFIER) * int_pow(10,
                ((strlen(str) - count) + 1));
      }
    if(result > 10)
          return result / 10;
    return 0;
}

It doesn't work though. : (

_________________________________________________________________
Sign-up for a FREE BT Broadband connection today! 
http://www.msn.co.uk/specials/btbroadband

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list