omg is bool not a data type in C?

beer

Lifer
Jun 27, 2000
11,169
1
0
wtf
I've been doing C++ for years
I'm doing my first really easy C programming assignment
and it's not recognizing a variable declared as bool

wtf?
 

beer

Lifer
Jun 27, 2000
11,169
1
0
for bool you should NOT need to include any libraries
at least we didn't we C++

 

A5

Diamond Member
Jun 9, 2000
4,902
5
81
All I know how to do in C is formatting printf statements and doing basic scanf functions...we start loops in a few days though :p
 

beer

Lifer
Jun 27, 2000
11,169
1
0
Originally posted by: z0mb13
no its not

EDIT: IIRC 0 (zero) is false in C, everyhting else is true

Does any have the code for enumerating the boolean data types? I havent dealt with enums in a while
 

z0mb13

Lifer
May 19, 2002
18,106
1
76
Originally posted by: Elemental007
Originally posted by: z0mb13
no its not

EDIT: IIRC 0 (zero) is false in C, everyhting else is true

Does any have the code for enumerating the boolean data types? I havent dealt with enums in a while

what do you mean?
 

z0mb13

Lifer
May 19, 2002
18,106
1
76
Originally posted by: bleeb
Originally posted by: z0mb13
no its not

EDIT: IIRC 0 (zero) is false in C, everyhting else is true

haha i like that Mod vs Nef quote. funny stuff.

yep I got that from the thread I started: Legolas vs Robin Hood
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
bool *is* a data type in C; however, it is only defined in ANSI C99, not C89. Most compilers are C89 conformant, not C99.

If you're doing win32, you could always #include <windows.h> and use BOOL, or worse, VARIANT_BOOL and TRUE/FALSE.
 

SnapIT

Banned
Jul 8, 2002
4,355
1
0
Originally posted by: Elemental007
wtf
I've been doing C++ for years
I'm doing my first really easy C programming assignment
and it's not recognizing a variable declared as bool

wtf?

Sure it does, you just have to declare it the right way...