TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Frank Adam
from: Peter Collis
date: 1996-05-21 13:43:36
subject: strwildcmp :)

While listening to Frank Adam Pete heard:strwildcmp :)

G'day Frank

 FA> Talking about strcmp() i have noticed something that nobody
 FA> mentioned, it actually returns the ascii code of the character
 FA> it fails on in str1,  and negates it if *str2 > *str1.

I've never noticed this, what compiler are you using.

The code below returns 0, 1 & -1 with my compiler (QC25)

#include 

int main(void) {

int retval;

    retval = strcmp("aa0","aa0");
    retval = strcmp("aa2","aa1");
    retval = strcmp("aa1","aa2");

    return 0;

}

   -=Pete=-


--- OMX/Blue Wave v2.12
* Origin: Gates of Hell (3:713/914.16)
SEEN-BY: 50/99 620/243 623/630 711/401 409 410 413 430 808 809 932 934
SEEN-BY: 712/508 515 713/111 317 601 611 615 618 700 826 888 914 714/906
SEEN-BY: 800/1
@PATH: 713/914 615 888 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.