title: How Logical operators work with constant operand in objective c
body: <p>I am working on project where I have the <strong>checkInternet</strong> method in one of my class for verifying internet availability. In that method I have following code:</p>
  
  <p>For below code of line I am getting warning that, <strong>"Using Logical &amp;&amp; with constant operand"</strong>
  for this code of block <strong>(flag &amp;&amp; kSCNetworkFlagsReachable)</strong>.</p>
  
  <pre><code>BOOL isavailable = NO;
  Boolean success;
  isavailable = success &amp;&amp; (flag &amp;&amp; kSCNetworkFlagsReachable) &amp;&amp; !(flag &amp; kSCNetworkFlagsConnectionRequired);
  </code></pre>
  
  <p>and as a solution xcode giving option that "Use &amp; for bitwise operand" that's fine I do it like that and it removed my warning.
  But I want know how it was working logical operators? and Why it's telling me to change to for bitwise?</p>