There's a bazillion ways to do this.

First. don't make a function called 'bool'.
it's a reserved word.
Second, why do you want to make a function that returns true when you can
just check it in your code?


just do this:

  if (test == TRUE)
      do_this();
  else
      do_that();

Seriously, don't over complicate it :)


> -----Original Message-----
> From: wkwok [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 09, 2002 9:46 PM
> To: [email protected]
> Subject: making a bool
> 
> 
> 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?
> 
> the code i thought up to make a bool function would be 
> something like...
> 
> int bool(char boolvalue)
> {
>       if(boolvalue==TRUE)
>               return 1;
>       else
>               return 0;
> }
> 
> seems pretty simple... ?
> 
> however would i be able to make it so i could actually type:
> 
> bool test;
> 
> if (test)
>   statments;
> 
> or would i have to do...
> 
>   char test;
>   test = FALSE;
>   bool(test);
> 
> witch just seems to be a big pain.
> 
> thanks in advance
>       Infernal
> 
> 
> 
> 
> -- 
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
> 

Reply via email to