gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > swich & bool

#100859 - cppdungeon - Thu Aug 31, 2006 6:17 am

im writing some code that needs a swich statement to return false as a default, but when i write
Code:

bool fun(a){

swich(a){
default: return false;
}
}


it wont compile. how can i make it return false?
_________________
"in Soviet Russia, car pimps you!"

#100865 - cppdungeon - Thu Aug 31, 2006 7:09 am

neeevermiind. i just remembered c doesent HAVE bool and i forgot to define it in the beginnging. sorry.
_________________
"in Soviet Russia, car pimps you!"

#100901 - tepples - Thu Aug 31, 2006 3:33 pm

GCC 4.x includes more support for C99, where you can #include <stdbool.h>
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.