Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Boolean variables in C

Name: Anonymous 2010-05-30 12:44

Has anyone created a method for using a byte as 8 boolean variables in C? I could implement it myself, but I'm curious, as it seems that the usual is to use a whole int for logical values. What I mean is something like this:

bool a;
bool b;
bool c;
bool d;
bool e;
bool f;
bool g;
bool h;
bool i;


And from a to h it would use just one byte, but when it's going to allocate memory for i it would the first bit from another byte. Also, is this how C++ implements its boolean types, or does it use a integer per boolean variable?

Name: Anonymous 2010-05-30 15:20

>>10
Is that the /b/ people keep mentioning here?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List