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

Function main

Examples/NoModules/Chapter 12/Ex12_03/Ex12_03.cpp:19–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17};
18
19int main()
20{
21 Box firstBox {80.0, 50.0, 40.0}; // Create a box
22 double firstBoxVolume {firstBox.volume()}; // Calculate the box volume
23 std::cout << "Volume of Box object is " << firstBoxVolume << std::endl;
24
25 Box secondBox; // No longer causes a compiler error message
26}
27
28// Constructor definition
29Box::Box(double length, double width, double height)

Callers

nothing calls this directly

Calls 1

volumeMethod · 0.45

Tested by

no test coverage detected