0

Hi, I keep getting an undefined identifier error when I try to do this:

typedef char bool; // Make a bool type
char false = 0, true = 1; // Make true and false

void foo()
{
switch (something)
{
case 1:
bool aaaaa;
break;
}
}

It only gives me an error it if i try to declare it in a case. Please help :P

4
Contributors
7
Replies
8
Views
9 Years
Discussion Span
Last Post by Sci@phy
0

In Dev-C++ 4.9.9.2:
`bool' undeclared (first use in this function)

(Each undeclared identifier is reported only once for each function it appears in.)

0

Just some literature from wikipedia:
"In C99, there is a bool type, along with the values true and false, defined in the <stdbool.h>"

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.