Re: !!, what is it?



"Mike Wahler" <mkwahler@xxxxxxxxxxxx> writes:


[...]

> No, ! is an operator. It's result is always either zero or one.
^^^^^^^^^^^^

I think, C standarts says something about logical operations resusts;
if the result is false, it's value is 0 (zero). if the result is true,
it's value is non-zero (like -2, -1, 2, 3, ...). So, it must NOT be
one. This difference has seen according to compiler or target
platform.

For example; some compiler's headers provide TRUE and FALSE constants
like that;

#define FALSE 0
#define TRUE !FALSE

// or

#define TRUE (0==0)
#define FALSE !TRUE




[...]

Best Regards.

--
Cafer Şimşek
http://cafer.org
.



Relevant Pages

  • Re: !!, what is it?
    ... C standarts says something about logical operations resusts; ... > act as true. ... However, I repeat, the boolean operators will never return ...
    (comp.lang.c)
  • Re: (corr) !!, what is it?
    ... It's result is always either zero or one. ... C standarts says something about logical operations resusts; ... > Cafer Şimşek ... Prev by Date: ...
    (comp.lang.c)