Re: [NEWBIE] Stupid Newbie strcmp question

From: Invincibill (bill@longboys.net)
Date: 01/17/99


to expound...
a < A

a > ,

AB < a

look at your ascii chart. if the first letter of the first word, then
the whole word is less. regardless of the remaining letters.

look at the machine representation of the value, not the human
representation.  in this way, you can compare integers and characters,
structs and structs, structs and arrays, etc(you have to know more than
the compiler, and you will get warnings, but you can do it. its the
wonderful think about C/C++)



"Brandon Lees (Whitlock)" wrote:
>
> Every letter has a numerical value associated with it.  The strcmp simply
> subtracts these two for each pari of letters in the string and if it anything other than
> zero then the string is not equl but if it is equl then it returns zero because there is
> no difference.  THis can be confusing at first but it does have some logic to it.
>
> - Brandon
>
>      +------------------------------------------------------------+
>      | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>      |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
>      +------------------------------------------------------------+

--
Weather forecast for today: Sunny & Mild
Weather forecast for tomorrow : Sunny & Mild
www.giftsgalore.com : www.longboys.net
telnet://undying.longboys.net:4000 http://undying.longboys.net


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



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