while true: !!!

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Tue Dec 19 14:11:17 EST 2000


Tue, 19 Dec 2000 06:38:27 GMT, Greg Jorgensen <gregj at pobox.com> pisze:

> I remember a C++ programmer I worked with who though that true and
> false were keywords until he discovered this (typical) definition
> in a header file:
> 
>     enum { false = 0, true = -1 };

bool, false and true are keywords in C++ and don't require #inclusion
of any header. The mentioned compiler is not conforming to ISO/ANSI C++
(perhaps because it's old).

In C99 _Bool is a keyword, and bool, false and true are macros defined
in <stdbool.h>.

True converted to an integer is 1, not -1.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list