Mail Archives: djgpp/1997/11/02/08:19:06
Klywarre (THE AVATAR) wrote:
> if(strcmp(argv[1], "\\c"))
[snip]
> when any character is used after the '\' character, the
> message to enter a file name appears ---- not what it's supposed to
> do!!! only when the option is '\c'.
strcmp returns 0 when the strings are equal. So when you compare the two
strings, if they are the same, the result is 0, hence false, the if
block is not executed, and the else is instead. I think what you meant
was:
if(strcmp(argv[1], "\\c") != 0)
--
[ Ryan Blazecka -- http://www.deninc.com/~corrosion/ ]
[ _corrosion_ AT geocities DOT com OR eblazecka AT bc DOT sympatico DOT ca ]
- Raw text -