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

Function main

Examples/NoModules/Chapter 16/Ex16_07B/Ex16_07B.cpp:10–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8double* computeValues(size_t howMany); // A function to compute an array of values
9
10int main()
11{
12 try
13 {
14 double* values{ computeValues(10'000) };
15 // Unfortunately we won't be making it this far...
16 delete[] values;
17 }
18 catch (const Trouble&)
19 {
20 std::cout << "No worries: I've caught it!" << std::endl;
21 }
22}
23
24double* computeValues(size_t howMany)
25{

Callers

nothing calls this directly

Calls 1

computeValuesFunction · 0.70

Tested by

no test coverage detected