Here's my array:
std::array<int, 4> mark;
Here's a function I have:
float getAverage() {
float sum = 0;
sum = std::accumulate(mark, mark + mark.size(), 0);
return sum /= mark.size();
}
But I get following error:
Invalid operands to binary expression ('std::array<int, markAmount>' and 'std::__1::array::size_type' (aka 'unsigned long'))
Which is understandable, as mark and mark.size() 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 array similar to &array[0]? As this is what I need for std::accumulate.