Re: C Questions
- From: pete <pfiland@xxxxxxxxxxxxxx>
- Date: Mon, 05 Nov 2007 07:49:52 -0500
Richard Heathfield wrote:
pete said:
Richard Heathfield wrote:
! yields 0 if its (numeric!) operand is non-zero, and 1 otherwise.
! yields 0 if its scalar operand does not compare equal to zero,
and 1 otherwise.
Oh yes, you can do !p, can't you?
I see that as being rather silly, but
you're quite right that it's legal. I'm not sure that I see the
distinction between "is non-zero"
and "does not compare equal to zero". I
consider them to be equivalent statements.
A type conversion is required for a pointer
to be compared to zero,
and that's the difference between "compares" and "is".
Some more musings concerning the difference between
"compares" and "is":
(0) compares equal to (0u)
(-1) compares greater than (0u)
(0) compares greater than (-1)
Is (-1) greater than or less than (0u)?
--
pete
.
- References:
- C Questions
- From: aarklon
- Re: C Questions
- From: Ben Pfaff
- Re: C Questions
- From: aarklon
- Re: C Questions
- From: Old Wolf
- Re: C Questions
- From: aarklon
- Re: C Questions
- From: Keith Thompson
- Re: C Questions
- From: aarklon
- Re: C Questions
- From: Richard Heathfield
- Re: C Questions
- From: pete
- Re: C Questions
- From: Richard Heathfield
- C Questions
- Prev by Date: Some suggestion required regarding get line functionality.
- Next by Date: Re: bitwise operator and endianness
- Previous by thread: Re: C Questions
- Next by thread: Re: C Questions
- Index(es):
Relevant Pages
|