delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/08/00:27:31

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: enum and djgpp
Date: Mon, 07 Apr 1997 06:31:30 -0700
Organization: Two pounds of chaos and a pinch of salt
Message-ID: <3348F732.6C6F@cs.com>
References: <33494D3F DOT 606307FA AT cs DOT buffalo DOT edu>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp226.cs.com
Mime-Version: 1.0
Lines: 27
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

mtc AT acsu DOT buffalo DOT edu wrote:
> 
>     I am just try to do a simple enum like
> 
>     enum constants { false = 0, true = 1};
> 
>     This statement which will compile under other compilers will not
> with djgpp I get a parse error before false and a missing ';' after
> right bracket error. any ideas ?

In GNU C++, the constants 'boolean' (or is it 'bool'?), 'false' and
'true' are already defined as part of the C++ syntax.  You get a parse
arror because they are reserved words.  You can either use the builtin
definitions, or use 'FALSE' and 'TRUE', or whatever else suits your
fancy.

-- 
John M. Aldrich <fighteer AT cs DOT com>                      

* Anything that happens, happens.
* Anything that, in happening, causes something else to happen,
  causes something else to happen.
* Anything that, in happening, causes itself to happen again, happens
  again.
* It doesn't necessarily do it in chronological order, though.
 
                                       --- Douglas Adams

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019