Re: void and this
From: E. Robert Tisdale (E.Robert.Tisdale_at_jpl.nasa.gov)
Date: 10/10/03
- Next message: lilburne: "Re: copy ctor question"
- Previous message: paul calvert: "INTERNAL COMPILER ERROR C1001: msc1.cpp (line 1794) error at every std include file: stdio.h, windows.h, ansi_c.h ????"
- In reply to: Dave Vandervies: "Re: void and this"
- Next in thread: Dave Vandervies: "Re: void and this"
- Reply: Dave Vandervies: "Re: void and this"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 10 Oct 2003 11:11:18 -0700
Dave Vandervies wrote:
> Gavin Deane wrote:
>
>>not do that. Doesn't C99 have a built in boolean type now?
>
> C99 has a built in boolean type (_Bool), as well as a standard header
> (<stdbool.h>) that defines macros for bool, true, and false.
>
> Since in practice you're unlikely to be able to avoid having to coexist
> with C90 for quite some time, this doesn't make it any easier to use
> bool in headers that have to be both C- and C++-clean.
> It's probably still best to use int and document that
> the value represents a boolean value for that.
This is *bad* advice.
C90 programmers should provide their own stdbool.h header file:
#ifndef guard_stdbool_h
#define guard_stdbool_h 1
typedef int bool;
const int false = 0;
const int true = !false;
#endif/*guard_stdbool_h */
- Next message: lilburne: "Re: copy ctor question"
- Previous message: paul calvert: "INTERNAL COMPILER ERROR C1001: msc1.cpp (line 1794) error at every std include file: stdio.h, windows.h, ansi_c.h ????"
- In reply to: Dave Vandervies: "Re: void and this"
- Next in thread: Dave Vandervies: "Re: void and this"
- Reply: Dave Vandervies: "Re: void and this"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]