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

Function main

Examples/Modules/Chapter 12/Ex12_05A/Ex12_05A.cpp:35–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34
35int main()
36{
37 Box box1{ 2.0, 3.0, 4.0 }; // An arbitrary box
38 Box box2{ 5.0 }; // A box that is a cube
39 std::cout << "box1 volume = " << box1.volume() << std::endl;
40 std::cout << "box2 volume = " << box2.volume() << std::endl;
41
42 Box box3{ box2 };
43 std::cout << "box3 volume = " << box3.volume() << std::endl; // Volume = 125
44}
45
46// A constructor that initializes all three member variables
47Box::Box(double length, double width, double height)

Callers

nothing calls this directly

Calls 1

volumeMethod · 0.45

Tested by

no test coverage detected