title: C array comparison
body: <p>Is the defacto method for comparing arrays (in C) to use <code>memcmp</code> from <code>string.h</code>?</p>
  
  <p>I want to compare arrays of ints and doubles in my unit tests</p>
  
  <p>I am unsure whether to use  something like:</p>
  
  <pre><code>double a[] = {1.0, 2.0, 3.0};
  double b[] = {1.0, 2.0, 3.0};
  size_t n = 3;
  if (! memcmp(a, b, n * sizeof(double)))
      /* arrays equal */
  </code></pre>
  
  <p>or to write a bespoke <code>is_array_equal(a, b, n)</code> type function?</p>