TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Frank Adam
from: Joshua Marshall
date: 1996-04-22 16:47:12
subject: Re: Filename Expansion

Hello Frank,
 In a message dated 20 Apr 96 you wrote to Paul Edwards :

 FA> What really freaks me is that FALSE is defined as 0, so according to 
 FA> that, are the next lines true or false ?

 FA> strcmp("hello","hello");  hardly FALSE, but it is 0.

strcmp does not return a boolean value.  It does not compare the strings
for identity or not, it gives an output to tell you whether one string is
alphabetically before the other string.  It uses negative and positive
numbers for position, and it just happens that zero is all that's left to
tell you that they are at the same place alphabetically.

Since the function is not specified as returning a boolean value then you
can't expect a boolean value out of it.  What you want is:

int franks_strcmp(char *s1, char *s2)
{
  int i;

  for (i=0;i * Origin: It's rude to Point (3:640/452.35{at}fidonet)
SEEN-BY: 50/99 78/0 620/243 623/630 640/151 201 206 216 217 222 230 238 247
SEEN-BY: 640/281 305 309 370 375 452 452 531 820 821 822 823 890 895 937
SEEN-BY: 690/660 711/401 409 410 413 430 808 809 932 934 712/515 713/888
SEEN-BY: 714/906 800/1 7877/2809
@PATH: 711/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™.