1

当尝试将数组作为参数传递时,我得到:

"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)

我敢肯定这是我不明白的简单事情,但我是新手。

4

1 回答 1

5

你的调用失败的真正原因是你传递了一个item&你的函数需要一个item*. 您的代码违反了字符串的 const 正确性,但在 C++03 中,它们有一个特殊规则,使之合法。

于 2012-05-21T04:38:53.027 回答