linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* TRUE FALSE
@ 2002-06-23  2:21 Gerald Waugh
  2002-06-23  2:52 ` Michael H. Warfield
  2002-06-23  3:02 ` Glynn Clements
  0 siblings, 2 replies; 4+ messages in thread
From: Gerald Waugh @ 2002-06-23  2:21 UTC (permalink / raw)
  To: linux-c-programming

Oh, I know this is dumb
But where is TRUE and FALSE defined
I tried several 'h' files
TIA

-- 
Gerald Waugh 
http://frontstreetnetworks.com  SOHO Networks & Web Site Hosting
Front Street Networks LLC     voice +1 203 785 0699 * fax +1 203 785 1787
229 Front Street, Ste. #C, New Haven CT 06513-3203 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TRUE FALSE
  2002-06-23  2:21 TRUE FALSE Gerald Waugh
@ 2002-06-23  2:52 ` Michael H. Warfield
  2002-06-23  3:02 ` Glynn Clements
  1 sibling, 0 replies; 4+ messages in thread
From: Michael H. Warfield @ 2002-06-23  2:52 UTC (permalink / raw)
  To: Gerald Waugh; +Cc: linux-c-programming

On Sat, Jun 22, 2002 at 10:21:16PM -0400, Gerald Waugh wrote:
> Oh, I know this is dumb
> But where is TRUE and FALSE defined
> I tried several 'h' files
> TIA

	Man, these things are defined all over the place.

	I LOVE this pair though:

mm.h:#define FALSE 0
mm.h:#define TRUE !FALSE

	Cool...  <mm.h> defines FALSE to be zero and TRUE to be not FALSE.
Someone had a poetic sense in writing it that way...

	:-)

	Now...  As to what include file you should include to get the
definitions (which I'm assuming is what you really wanted to know
rather than what you asked), I don't know.  Depends on the application.
It's defined in some X11 header files and some SQL header files.  Depends
on what you are doing...

> -- 
> Gerald Waugh 
> http://frontstreetnetworks.com  SOHO Networks & Web Site Hosting
> Front Street Networks LLC     voice +1 203 785 0699 * fax +1 203 785 1787
> 229 Front Street, Ste. #C, New Haven CT 06513-3203 

	Mike
-- 
 Michael H. Warfield    |  (770) 985-6132   |  mhw@WittsEnd.com
  /\/\|=mhw=|\/\/       |  (678) 463-0932   |  http://www.wittsend.com/mhw/
  NIC whois:  MHW9      |  An optimist believes we live in the best of all
 PGP Key: 0xDF1DD471    |  possible worlds.  A pessimist is sure of it!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TRUE FALSE
  2002-06-23  2:21 TRUE FALSE Gerald Waugh
  2002-06-23  2:52 ` Michael H. Warfield
@ 2002-06-23  3:02 ` Glynn Clements
  2002-06-28 12:20   ` Ducrot Bruno
  1 sibling, 1 reply; 4+ messages in thread
From: Glynn Clements @ 2002-06-23  3:02 UTC (permalink / raw)
  To: Gerald Waugh; +Cc: linux-c-programming


Gerald Waugh wrote:

> Oh, I know this is dumb
> But where is TRUE and FALSE defined

They aren't defined in any standard header; if you want them to be
defined, you have to define them yourself.

However, you should allow for the possibility that some other header
may define them, so only define them if they are undefined, i.e.

	#ifndef TRUE
	#define TRUE 1
	#endif

-- 
Glynn Clements <glynn.clements@virgin.net>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TRUE FALSE
  2002-06-23  3:02 ` Glynn Clements
@ 2002-06-28 12:20   ` Ducrot Bruno
  0 siblings, 0 replies; 4+ messages in thread
From: Ducrot Bruno @ 2002-06-28 12:20 UTC (permalink / raw)
  To: Glynn Clements; +Cc: Gerald Waugh, linux-c-programming

On Sun, Jun 23, 2002 at 04:02:41AM +0100, Glynn Clements wrote:
> 
> Gerald Waugh wrote:
> 
> > Oh, I know this is dumb
> > But where is TRUE and FALSE defined
> 
> They aren't defined in any standard header; if you want them to be
> defined, you have to define them yourself.

Right, but wrong in some sense.  ANSI C99 define the type 'bool' in stdbool.h

FALSE and TRUE didn't exist in any standard, though.  You have to use
actually 'true' and 'false' instead if you want to use stdbool.h.


-- 
Ducrot Bruno
http://www.poupinou.org        Page profaissionelle
http://toto.tu-me-saoules.com  Haume page

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-06-28 12:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-23  2:21 TRUE FALSE Gerald Waugh
2002-06-23  2:52 ` Michael H. Warfield
2002-06-23  3:02 ` Glynn Clements
2002-06-28 12:20   ` Ducrot Bruno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).