title: Using std::accumulate to find sum of array
body: <p>Here's my array:</p>
  
  <pre><code>std::array&lt;int, 4&gt; mark;
  </code></pre>
  
  <p>Here's a function I have:</p>
  
  <pre><code>float getAverage() {
          float sum = 0;
          sum = std::accumulate(mark, mark + mark.size(), 0);
          return sum /= mark.size();
      }
  </code></pre>
  
  <p>But I get following error:</p>
  
  <pre><code>Invalid operands to binary expression ('std::array&lt;int, markAmount&gt;' and 'std::__1::array::size_type' (aka 'unsigned long'))
  </code></pre>
  
  <p>Which is understandable, as <code>mark</code> and <code>mark.size()</code> have different types, but I don't understand how to make it in other way. Should I cast their types? But why it's not made automatically?
  Is <code>array</code> similar to <code>&amp;array[0]</code>? As this is what I need for <code>std::accumulate</code>.</p>