[Courses] re: [C] lesson 7
Kathryn Hogg
kjh at flyballdogs.com
Wed Nov 6 09:46:56 EST 2002
> Hardcoding a boolean self-defined type would only make the program look
> a little more confusing than required later on.
I find that it makes things less confusing. Whenever you see 'boolean'
you know that the range of possible values is {true, false}' whereas with
an int, you may not know what is expected. This comes in quite handy when
perusing prototypes in header files.
> u>
> u> Or in C++ with
> u>
> u> typedef enum boolean{false, true};
C++ (standard C++ that is) has a built in bool type which can have the
values true or false.
--
Kathryn
More information about the Courses
mailing list