title: C++ - How to check if not equal with the & operator
body: <p>I am working on a project and we keep track of flags in a single byte.</p>
  
  <p>That byte can be set with a few options. For example:</p>
  
  <pre><code>0x00000001 - Person
  0x00000002 - Object
  0x00000003 - Vehicle
  </code></pre>
  
  <p>Now, when it comes time to check these objects we can do this:</p>
  
  <p>if(flags&amp;0x00000001)
  {
      // this is a person
  }</p>
  
  <p>The problem is, I want to know how to check and see if it is not a person. Forgive me if this is a simple answer but I have tried if !flags&amp;0x00000001 and it does not check out. I have also tried comparing it to 0 and still, no luck.</p>