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

Function main

Exercises/NoModules/Chapter 14/Soln14_03/Soln14_03.cpp:7–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include "Animals.h"
6
7int main()
8{
9 Lion myLion{"Leo", 400};
10 Aardvark myAardvark{"Algernon", 50};
11 std::cout << "Calling derived versions of who():\n";
12 myLion.who();
13 myAardvark.who();
14
15 std::cout << "\nCalling base versions of who():\n";
16 myLion.Animal::who(); // By qualifying the base class
17 static_cast<Animal&>(myAardvark).who(); // By casting
18}

Callers

nothing calls this directly

Calls 1

whoMethod · 0.45

Tested by

no test coverage detected