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

Function main

Examples/NoModules/Chapter 14/Ex14_04B/Ex14_04B.cpp:10–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8/* Note: this example will fail to compile! */
9
10int main()
11{
12 // Create three Carton objects
13 Carton carton1; std::cout << std::endl;
14 Carton carton2 {4.0, 5.0, 6.0, "PET"}; std::cout << std::endl;
15 Carton carton3 {2.0, "Folding boxboard"}; std::cout << std::endl;
16
17 std::cout << "carton1 volume is " << carton1.volume() << std::endl;
18 std::cout << "carton2 volume is " << carton2.volume() << std::endl;
19 std::cout << "carton3 volume is " << carton3.volume() << std::endl;
20}

Callers

nothing calls this directly

Calls 1

volumeMethod · 0.45

Tested by

no test coverage detected