Re: String to Integer

From: Archangel (9605217d@LUX.LEVELS.UNISA.EDU.AU)
Date: 09/30/97


> 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.
i.e.

int skillint;
char *namestring;
.
.
.
skillint = aoti(namestring);

or (if skillint is long)

skillint = atol(namestring);

Rohan Wallace


     +------------------------------------------------------------+
     | 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