C++: Accessing parent methods and variables

前端 未结 3 518
孤独总比滥情好
孤独总比滥情好 2021-01-04 10:06

In which way should I access this parent method and parent variable?

class Base
{
public:
    std::string mWords;
    Base() { mWords = \"blahblahblah\" }
};         


        
3条回答
  •  孤城傲影
    2021-01-04 10:44

    Since there is no naming conflict, simply use Write(mWords). Use the other 2 if you have local variables that conflict, or when the names are hidden.

提交回复
热议问题