MCPcopy Create free account
hub / github.com/ShiqiYu/CPP / array_sum

Function array_sum

week04/examples/const-array.cpp:6–15  ·  view source on GitHub ↗

float array_sum(const float *values, size_t length) float array_sum(const float values[4], size_t length)

Source from the content-addressed store, hash-verified

4//float array_sum(const float *values, size_t length)
5//float array_sum(const float values[4], size_t length)
6float array_sum(const float values[], size_t length)
7{
8 float sum = 0.0f;
9 for (int i = 0; i < length; i++)
10 {
11 sum += values[i];
12 //values[i] = 0; //error
13 }
14 return sum;
15}
16
17int main()
18{

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected