gpt4 book ai didi

C++ 指针机制 - 错误 2440

转载 作者:太空宇宙 更新时间:2023-11-04 14:15:10 27 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Conversion of pointer-to-pointer between derived and base classes?
Converting Derived** to Base** and Derived* to Base*

我有一个 intf + 类

class IList
{
public:
virtual IList** GetChildList()=0;
virtual void SetChildList(IList**)=0;
~IList();
};

class CList:public IList
{
CList** m_lst;
public:
IList** GetChildList()=0;
virtual void SetChildList(IList**);
//...
};

IList** CList::GetChildList()
{
return m_lst;
}

为什么我在 MSVC 中的 GetChildList 中收到错误 2440,提示“'return':无法从 'CList** **' 转换为 'IList **”

提前感谢您的帮助!

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com