title: Checking if two arrays are equal - C
body: <p>How would I go about checking the equality of two arrays using memcmp?</p>
  
  <pre><code>bool array_is_equal(const void *array_one, void *array_two, const size_t elem_size, const size_t elem_count)
  </code></pre>
  
  <p>I have something like this:</p>
  
  <pre><code>int i;
  for(i = 0; i &lt; elem_count; i++){
      if(memcmp(array_one, array_two, elem_size) == 0) {
          return true;
      }
      i++;
   }
  
  return false;
  </code></pre>
  
  <p>with elem_size being the number of bytes each array element uses in array one</p>