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

Function main

Examples/Modules/Chapter 12/Ex12_02/Ex12_02.cpp:23–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

volumeMethod · 0.45

Tested by

no test coverage detected