Error of invalid operands to binary expression

Dear Expert,

I am having a problem with if statement below.

 if ((Dz_mcErrors & 128) != 0) 
  {
   h4->Fill(Dz_M);
   } 

here I want to select the flag 128 from mcErrors and checking if this value is non-zero.

But its giving following error:

I am not sure how to solve this problem.
Please help me to sort it out.

Regards
Chanchal

Try: if (((unsigned long)Dz_mcErrors & 128) != 0)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.