From: kunst AT prl DOT philips DOT nl (Pieter Kunst) Subject: Re: STRCMP (problem?) To: ckgp!thomas AT uunet DOT uu DOT net Date: Thu, 11 Mar 93 8:22:07 MET Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (DJGPP users list) Mailer: Elm [revision: 70.30] Michael Thomas writes: > I noticed something strange and was wondering if anyone else has > noticed this? when using strcmp the result numbers are about 46 > so > > stat = strcmp("number","number"); stat == 46 > stat = strcmp("number","number#"); also stat==46 > stat = strcmp("is","what"); stat == 41 > stat = strcmp("was","that"); stat == 55 > > Isn't strcmp supposed to return numbers <0,=0,>0 as results? > When I noticed this I wrote a simple program to compare to strings > and print the result... then I thought that it might have something > to do with 2.3.3 so I loaded 2.2.2 again and the same thing happens... > I am running djgpp 1.09... > > any ideas? is this suposed to be like this... if so is 46 equivalent > to 0, and why do you think comparing number,number is the same as > comparing number,number# ? > > Any information would be great! Thanks... > It sounds to me that you didn't include the correct prototype files in your program. Add the following line at the start of your program: #include or else at least something like: int strcmp(const char *s1, const char *s2); -- Pieter Kunst (kunst AT prl DOT philips DOT nl)