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

Function main

Examples/NoModules/Chapter 15/Ex15_11/Ex15_11.cpp:9–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include "Can.h" // for the Can class
8
9int main()
10{
11 Box box {40, 30, 20};
12 Can can {10, 3};
13 Carton carton {40, 30, 20, "Plastic"};
14 ToughPack hardcase {40, 30, 20};
15
16 std::vector<const Vessel*> vessels {&box, &can, &carton, &hardcase};
17
18 for (const auto* vessel : vessels)
19 std::cout << "Volume is " << vessel->volume() << std::endl;
20}

Callers

nothing calls this directly

Calls 1

volumeMethod · 0.45

Tested by

no test coverage detected