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

Function main

Examples/NoModules/Chapter 08/Ex8_09A.cpp:7–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5double average10(const double (&)[10]); // Function prototype
6
7int main()
8{
9 // Use 10 values to make example compile...
10 // double values[] { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 };
11 double values[] { 1.0, 2.0, 3.0 }; // Only three values!!!
12 std::cout << "Average = " << average10(values) << std::endl;
13}
14
15// Function to compute an average
16double average10(const double (&array)[10]) /* Only arrays of length 10 can be passed! */

Callers

nothing calls this directly

Calls 1

average10Function · 0.70

Tested by

no test coverage detected