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

Function main

Examples/NoModules/Chapter 15/Ex15_01/Ex15_01.cpp:5–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

showVolumeMethod · 0.45

Tested by

no test coverage detected