title: l-value required as left operand of assignment error - but why?
body: <p>In general I know why you get this error, but I'm a little confused in this particular instance...</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  char* mystrncpy(char* dst, const char* src, size_t n) {
      char* temp = dst;
  
      while (n-- &gt; 0 &amp;&amp; (*temp = *src)) {
          temp++;
          src++;
      }
  
      return dst;
  }
  
  int main() {
      const char* str = "Hello World!";
      char buf[50];
      memset(buf, 0, sizeof(buf));
      mystrncpy(buf, str, sizeof(buf));
      printf("%s\n", buf);
  }
  </code></pre>
  
  <p>The code above works great, but if I remove the extra set of brackets changing the while loop to:</p>
  
  <pre><code>while (n-- &gt; 0 &amp;&amp; *temp = *src)
  </code></pre>
  
  <p>Then I get the error.  I guess it's something about operator precedence but I'm a little baffled.  Can someone explain what that while loop alteration does to make this compiler error appear?</p>