I am trying out the below snippet,
#include <string>
class A {
protected:
std::string name;
public:
A(std::string name):name(){}
};
class B: public A {
public:
B() : A("B") {}
};
class C: public B {
public:
C(): A("C"){} //<-- this is not allowed, but I want to make C has its own name
};
Obviously, this is not allowed, what is the best way I can achieve this?