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

Function main

Examples/Modules/Chapter 15/Ex15_01/Ex15_01.cpp:4–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import boxes;
3
4int main()
5{
6 Box box {20.0, 30.0, 40.0}; // Create a box
7 ToughPack hardcase {20.0, 30.0, 40.0}; // Create a tough pack - same size
8
9 box.showVolume(); // Display volume of base box (calls volume() for box)
10 hardcase.showVolume(); // Display volume of derived box (call volume() for hardcase)
11
12 //std::cout << "hardcase volume is " << hardcase.volume() << std::endl;
13 //Box* box_pointer{ &hardcase };
14 //std::cout << "hardcase volume through a Box* pointer is "
15 // << box_pointer->volume() << std::endl;
16}
17

Callers

nothing calls this directly

Calls 1

showVolumeMethod · 0.45

Tested by

no test coverage detected