I have (unfortunately) found out that C doesn't support the "bool" keyword. So what is the most common (or best) way to use boolean statements in my code?
I have tried this:
and then I used "0" instead of "false" and "1" instead of "true".Code:typedef int bool;
But this seems to me a little "waste" of memory. I just want to store only 2 values (true and false) but I use "4 bytes" (sizeof(int)) instead. So maybe it would be better to use this:
and occupy only "1 byte" (sizeof(char)) of memory. But what should then I use instead of "false" and "true"? For example 'n' and 'y', or what?Code:typedef char bool;