parse error

  • Thread starter Slavko Vorkapitch
  • Start date
S

Slavko Vorkapitch

Keep getting a 'parse error before false'....
'parse error before true'...

Using g++ - here's the code from file misc.h:

#ifndef misc_h
#define misc_h

const int false = 0;
const int true = 1;

#endif

Looks innocuous to me.
Any help appreciatd.

Thanks in advance,
El Squid
 
J

John Harrison

Keep getting a 'parse error before false'....
'parse error before true'...

Using g++ - here's the code from file misc.h:

#ifndef misc_h
#define misc_h

const int false = 0;
const int true = 1;

#endif

Looks innocuous to me.
Any help appreciatd.

Thanks in advance,
El Squid

false and true are keywords in C++. They are the two values of the bool
data type.

john
 
?

=?ISO-8859-15?Q?Juli=E1n?= Albo

Slavko said:
const int false = 0;
const int true = 1;

false and true are reserved words. Read about the bool type in any c++ book
not very old.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,431
Latest member
ElyseG3173

Latest Threads

Top