C++: Bitwise AND - Stack Overflow