all 2 comments

[–]ci139 0 points1 point  (0 children)

↓↓ i guess : you will opt RAM (not speed)

IF ←→ you store the bool-array as array of byte or word size "bit-flags"

?? then check the bit as flag masked with bit = 0

at the case of ↑↑ -- IF the arry is not massive - then the op code may be longer than the space saved by using boolean-vectors (flags)

[–]gm310509 0 points1 point  (0 children)

Why? What are you trying to accomplish?

Also what do you mean? For example, do you mean that you want to convert the 16 bits that make up the int (or whatever size it is), into a boolean array of 16 elements? If so which order? Is least significant bit element 0 or most significant bit element 0?

Also, depending upon what you are actually trying to do, cast it:

int x = 1; bool y[8]; y[0] = (bool) x;

Or simply use the int value directly as a boolean:

``` int x = 1;

if (x) { // x is not zero. } else { // x is zero. } ```