title: How did malloc and calloc end up with different signatures?
body: <blockquote>
  <p><strong>Possible Duplicate:</strong><br />
  <a href="https://stackoverflow.com/questions/7536413/why-calloc-takes-two-arguments-while-malloc-only-one">Why calloc takes two arguments while malloc only one?</a></p>
  </blockquote>
  
  <p>There are <em>lots</em> of resources describing the difference in functionality between <code>malloc</code> and <code>calloc</code>, but I can't easily find one that describes the history behind the differing function signatures:</p>
  <pre><code>   void *calloc(size_t nmemb, size_t size);
     void *malloc(size_t size);
  </code></pre>
  <p>Of course, the <code>size</code> in the former is the size for each member. Maybe the idea was that multiple-of-the-page-size member size <code>calloc</code>s could be done lazily via the operating system?</p>
  <p>(I can make up reasons as well as the next guy -- no accepted answers without cited sources. :-) )</p>