Re: program bug
Ian Collins wrote:
So what?
if (argv[1] == "b")
is not an error the compiler need diagnose. Both arguments are of type
(char *) and the chances the two pointer values are equal is nil but the
expression is completely valid.
--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Ian Collins wrote:
Robert Gamble wrote:
Oops, my bad, I spotted the comparisons an didn't spot they were with
argv[n].
>
>On May 2, 6:28 pm, Ian Collins <ian-n...@hotmail.co mwrote:
>My compiler didn't provide any warnings for this code, did yours?
>>
>>Why are you comparing characters with string literals? Surly your
>>compiler gave you some warnings?
>>compiler gave you some warnings?
>>
argv[n].
>
if (argv[1] == "b")
is not an error the compiler need diagnose. Both arguments are of type
(char *) and the chances the two pointer values are equal is nil but the
expression is completely valid.
--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Comment