title: Basic malloc, array, pointer and assignment error
body: <p>I have the following code.</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
  
      char *buf = malloc(sizeof(char *) *3);
      char *p = &quot;print&quot;;
      char *q = &quot;quit&quot;;
      char *r = &quot;reverse&quot;;
      
      buf[0] = p;
      buf[1] = q;
      buf[2] = r;
      
      printf(&quot;%s&quot;, buf[0]);
        
      return 0;
  
  }
  </code></pre>
  <p>I think <code>buf</code> will save the address of <code>char</code> variable.
  So, as <code>p</code> indicates the address of string, i think i can assign <code>p</code> to <code>buf[0]</code>.
  But compiler says &quot;assignment makes integer from pointer without a cast&quot;.
  Why this happens?</p>