title: Applications of bitwise operators in C and their efficiency?
body: <p>I am new to bitwise operators.</p>
  
  <p>I understand how the logic functions work to get the final result. For example, when you bitwise <code>AND</code> two numbers, the final result is going to be the <code>AND</code> of those two numbers (<code>1 &amp; 0 = 0</code>; <code>1 &amp; 1 = 1</code>; <code>0 &amp; 0 = 0</code>). Same with <code>OR</code>, <code>XOR</code>, and <code>NOT</code>.</p>
  
  <p>What I don't understand is their application. I tried looking everywhere and most of them just explain how bitwise operations work. Of all the bitwise operators I only understand the application of shift operators (multiplication and division). I also came across masking. I understand that masking is done using bitwise <code>AND</code> but what exactly is its purpose and where and how can I use it?</p>
  
  <p>Can you elaborate on how I can use masking? Are there similar uses for <code>OR</code> and <code>XOR</code>? </p>