I need to find a way to do a C++ Booleans in C, the way I've come up with so far is:
Which works fine. But, I need to know if this takes up less memory, than a char. Could I possibly take up one bit like 'int bool:1;' in a struct? Is there another less memory usage way?Code:typedef enum { false, true } bool; bool one = false;
Also, I thought I mention, I know there's a bool type in C99. But, I'm developing this for an embedded cpu, which I need to use a special compiler, libraries, the whole bit. I'm trying to save space.