[英]c++ "no matching function to call
当尝试传递数组作为参数时,我得到:
"No matching function to call to ' table::retrieve(const char[16], item&, int)'
我试图用
program.reference.retrieve("Abecean Longfin", program.client_item, 1);
功能是
int table::retrieve(char item_in[],item*item_list, int name_flag)
我确信这是我不了解的简单事物,但是我是新手。
调用失败的真正原因是因为您要传递item&
函数接受了item*
。 您的代码还违反了字符串的const正确性,但是在C ++ 03中,它们具有使该规则合法的特殊规则。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.