title: Why do I get: "error: assignment to expression with array type"
body: <pre><code>#include &lt;stdio.h&gt;
  
  int main(void) {
      int arr[10];
      arr = "Hello";
      printf("%s",arr);
      return 0;
  }
  </code></pre>
  
  <p>The above code shows compiler error:</p>
  
  <pre><code>t.c: In function ‘main’:
  t.c:5:9: error: assignment to expression with array type
       arr = "Hello";
           ^
  t.c:6:12: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int *’ [-Wformat=]
       printf("%s",arr);
              ^
  </code></pre>
  
  <p>Whereas the below code works fine.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void) {
      char arr[10] = "Hello";
      printf("%s",arr);
      return 0;
  }
  </code></pre>
  
  <hr>
  
  <p>Both look identical to me. What am I missing here?</p>