Mail Archives: djgpp/1993/03/10/17:28:49
>
> Isn't strcmp supposed to return numbers <0,=0,>0 as results?
>
It does, at least for me. (gcc 2.2.2)
Are you really sure those are the values you're getting?
This is what I get:
strcmp("number","number") = 0
strcmp("number","number#") = -35
strcmp("is","what") = -14
strcmp("was","that") = 3
The return value seems to be the ascii value difference at the first
character mismatch -- 'i'-'w' = -14, 'w'-'t' = 3, etc.
Have you checked that you're not doing something with another
variable that could corrupt stat? (like exceeding array bounds
or assigning a float value to an int...)
/gordon
-----------------------------------------------------------------------------
Gordon Beaton tel. 018-507405
gordon AT Minsk DOT DoCS DOT UU DOT SE +46-18-507405
- Raw text -