Skip to main content

Practice · 3 of 3

A protected extension point

CHALLENGE
Difficulty: intermediate+25 XP

Implement class Greeter with std::string greet() const returning "Hello, " + salutation() where salutation() is a protected member function returning "world". Implement class FormalGreeter : public Greeter overriding nothing but the base stays intact — the test calls both through their own types.

Back to lesson: Practice: Inheritance mechanics