It is not an overloading. The derived class has two data members with the same name r one of which is accessible in it and other is not accessible directly. I do not see any sense in such a declaration. It follows that Circle has its own radius and Smiley has its own additional radius. So one figure has two radiuses.
There is no need to assign variable r of class Circle protected access control because class Circle provides public interface to the variable via member function radius. So it would be better to define classes the following way
Everything works! How does the line of code above work exactly? I mean I know what it does, it's just I haven't seen it before. Thanks in advance!
Here the base class constructor with parameter is called explicitly, Otherwise the compiler would try to call the default base class constructor which is absent,
The similar effect could be achived if to use using declaration in the drived class.