0
C++ bitwise operator
How do you find bitwise AND of all elements of the array A = [33554431, 4, 1] in c++
1 Resposta
+ 3
Unless I misunderstand something, you can just calculate it:
int result = ( A[ 0 ] & A[ 1 ] & A[ 2 ] );
For arrays with more elements, one can use a loop instead.
However, here the result will be equal to zero anyway, since 4 & 1 = 0.