1
您能否解释为什么会发生以下错误,以及如何解决该问题?它给了我一个很大的问题,所以请我需要你的帮助将'this'指针从项目转换为const项目和编译器错误
错误(编译错误) -
the object has type qualifiers that are not compatible with the member function
*的项目成员是一组
问题线 -
temp.setName(items.find(itemList[option])->getName());
setName和getName函数 -
void Item::setName(string name)
{
this->_name = name;
}
string Item::getName()
{
return this->_name;
}
感谢所有工作良好(; – Alon