title: usage of strdup
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  int main()
  {    
      char *s;
      s = strdup("foo");
      printf("%s\n", s);
      getchar();
      return 0;
  }
  </code></pre>
  
  <p>Looks pretty harmless, doesn't it ?
  But my IDE, which is Dev-C++, gives my the following warning:
  warning: assignment makes pointer from integer without a cast</p>
  
  <p>The warning disappears if you would change the code like this:</p>
  
  <pre><code>char *s;
  s = (char*)strdup("foo");
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/5UCm0.jpg" alt="enter image description here"></p>
  
  <p>Can anyone help me explain this?</p>