There was a similar question [here](https://stackoverflow.com/questions/4044590/can-i-check-in-c-if-an-array-is-all-0-or-false), but the user in that question seemed to have a much larger array, or vector. If I have:

```
bool boolArray[4];

```

And I want to check if all elements are false, I can check [ 0 ], [ 1 ] , [ 2 ] and [ 3 ] either separately, or I can loop through it. Since (as far as I know) false should have value 0 and anything other than 0 is true, I thought about simply doing:

```
if ( *(int*) boolArray) { }

```

This works, but I realize that it relies on bool being one byte and int being four bytes. If I cast to (std::uint32\_t) would it be OK, or is it still a bad idea? I just happen to have 3 or 4 bools in an array and was wondering if this is safe, and if not if there is a better way to do it.

Also, in the case I end up with more than 4 bools but less than 8 can I do the same thing with a std::uint64\_t or unsigned long long or something?