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

Function main

Examples/NoModules/Chapter 16/Ex16_09/Ex16_09.cpp:6–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include "DimensionError.h" // For the dimension_error class
5
6int main()
7{
8 try
9 {
10 Box box1 {1.0, 2.0, 3.0};
11 std::cout << "box1 volume is " << box1.volume() << std::endl;
12 Box box2 {1.0, -2.0, 3.0};
13 std::cout << "box2 volume is " << box2.volume() << std::endl;
14 }
15 catch (const std::exception& ex)
16 {
17 std::cout << "Exception caught in main(): " << ex.what() << std::endl;
18 }
19}

Callers

nothing calls this directly

Calls 2

volumeMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected