clarification of int & int inside a if statement in C++ -


this question has answer here:

does statement return single bit or concatenation of bits.

if(mask[i] & groupbit) {     //... } 

with:

  • i = integer
  • mask[i] = element of integer pointer
  • groupbit = integer

it result in entire integer. when use bitwise and, each bit of 2 values and'ed together, , each bit in result set accordingly. result same number of bits values being and'ed together.

this assuming you're using 2 integer variables.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -