注册 登录
编程论坛 C++教室

请告诉我这句话的意思

xhle810131 发布于 2007-04-11 23:07, 449 次点击

下面是我的代码
int KString::findSubstring(const KString &strsub) //寻找
{
int i=strsub.getLenth();
if(m_nstrlen<i)
{

}
return 0;
}

报错为
error C2662: 'getLenth' : cannot convert 'this' pointer from 'const class KString' to 'class KString &'

2 回复
#2
布拉莫斯2007-04-11 23:19
你把你定义的那个getLenth()函数代码和相关的类发出来看才能知道的啊
#3
aipb20072007-04-12 10:50
getLenth() 函数的返回类型与调用不匹配
1