Darrell Grainger wrote:
On Mon, 18 Aug 2003, Marc Lasson wrote: Terry Andersen a écrit:
Why do my compiler error about:
<snip>
Do I need some includes to use the "bool"???
yes
#include <stdbool.h>
This only holds true for C99 compilers. The older compilers do
not have a stdbool.h header. For older compilers you will have to
create your own defines or see if the compiler has implemented a
header similar to the stdbool.h header.
I simply #include "stdops.h", which is the following:
/* Standard defines of operators, usable on C90 up */
#ifndef stdops_h
#define stdops_h
#if defined(__STDC__) && (__STDC_VERSION__ >= 199901L)
/* The following from C99 - must define for C90 */
#include <stdbool.h> /* define bool, true, false */
#include <iso646.h> /* define not, and, or, xor */
#else
#define false 0
#define true 1
typedef int bool;
#define not !
#define and &&
#define or ||
#define xor ^
#endif
#endif
--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!