MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / main

Function main

Exercises/NoModules/Chapter 09/Soln9_05.cpp:7–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5double average10(std::span<const double, 10> data); // Function prototype
6
7int main()
8{
9 double values[] { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 };
10 // double values[]{ 1.0, 2.0, 3.0 }; // Only three values!!!
11 std::cout << "Average = " << average10(values) << std::endl;
12}
13
14// Function to compute an average
15double average10(std::span<const double, 10> data)

Callers

nothing calls this directly

Calls 1

average10Function · 0.70

Tested by

no test coverage detected