后有点搜索我才知道,我可以这样调用父方法:在父类中调用一个方法
基类:
class Base
{
public:
Base();
child *children; // instance of the child is needed on the base
float theDelegate(char *arg);
然后子类:
class child: public Base //**** problem
{
public:
...
但是,当我试图添加public Base
行时,我收到一个错误,他不知道Base
。
于是我包括base
到的child
,与此:
#include "Base.hpp"
这时候孩子可以看到父,但权当我包括在child
的base
我就得到一个错误父母,因为他们包括彼此。
child *children; - unknown type name child - appear only if I include parent in the child
我在这里做错了什么?应该怎么做?
向前声明? –
具体答案?根据这里的问题,这个问题,我做了他们所展示的。 – Curnelious
上课的孩子;在你的基地 –