Re: String to Integer

From: Sammy (samedi@DHC.NET)
Date: 09/30/97


On Wed, 1 Oct 1997, Archangel wrote:

> > I was reading somewhere about how this mud was having their character
> > skills based off the name they enter. (in you name lies your true
> > power). I wanted to add this feature to my mud.  I need some ideas on
> > how to convert a string to get a numeric value.
>
> The easiest way to convert a string to an integer is to use atoi or atol.
> aoti converts to integer, atol converts to a long integer.

Hmmmm...

atoi("Samedi") = 0
atoi("Archangel") = 0
atoi("Anybody") = 0

atoi doesn't convert alphabetic strings to anything but 0, which wouldn't
be very useful for this application.

Sam


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST