--- wkwok <[EMAIL PROTECTED]> wrote:
> I know this isn't really a ROM question however i'm trying to write a 
> pfile editor and I want to learn to use C to do it.  I know C++ has a bool 
> function however i can't find it in C so i assume it isn't there I was 
> wondering 2 things first is there a bool in C if not where is the code in 
> ROM to make bool variables?


bool isn't supported in C. You can fake it though fairly easily.

#ifndef FALSE
const char FALSE=0;
#endif
#ifndef TRUE
const char TRUE=1;
#endif

typedef char bool;


Then in some function...

{
    bool test = FALSE;

    if(test)
        puts("Test is true");
    else
        puts("Test is false");
}



~Kender

=====
-----BEGIN GEEK CODE BLOCK-----
Version 3.1
GCS/L/C/O d-(+) s++:+ a-- C+++$>++++ UBLS++++$ 
P+++(--)$ L++>+++ E--- W+>++$ N !o K? w(--) !O 
M- !V PS+ PE(++) Y+ PGP->+ t- 5 X+() R(+) tv+@ 
b++(+++) !DI+++ D G(-) e>+++$ h---() r+++ y+++
------END GEEK CODE BLOCK------

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

Reply via email to