title: Using malloc correctly
body: <p>I'm trying to refresh my C skills. Let's say I'm trying to perform a <code>malloc</code> and a <code>calloc</code>:</p>
  
  <pre><code>void* allocate_array(size_t member_size, size_t nmember,bool clear)
         if(clear){
              void *cal = calloc(nmember, sizeof(member_size));
              return cal;
         } else if(!clear) {
              void *mal = (void *)malloc(sizeof(member_size));
              return mal;
         }
  </code></pre>
  
  <p>I think I'm using calloc correctly here but I am unsure if I am using malloc correctly. It confuses me when I need to return void.</p>