let's say I need to store 8 bools in a structure, but I want to use only 1 byte for them together, then I could do something like this:
struct myStruct { bool b1:1; bool b2:1; bool b3:1; bool b4:1; bool b5:1; bool b6:1; bool b7:1; bool b8:1; };
and with that I could do things like
myStruct asdf; asdf.b3=true; asdf.b4=false; if(asdf.b1) ...
How true is this? (I donβt know this actually, I have never used beatpods before)
ok - but it is also possible to create a static array of 8 bools, so that they will only use 8 bits, but can I still address them by index?
sort of
struct myStruct { public: bool b[8]:8; };
may be? (with this I get error message C2033)
thanks for the help!
source share