c++/error:对的调用没有匹配的函数
c++/error: no matching function for call to
我知道它相当基本,但我不太确定我的函数参数似乎有什么问题,但我一直得到错误:"没有匹配的函数用于调用‘input’和‘summary’"。
void Input (int **&x, int *&arr, int &size1,int &size2)
{
cout << "Please enter 2 non-negative integer values: "<< endl;
cout << "1. ";
cin >> size1;
int checkVal(int size1);
cout << "2. ";
cin >> size2;
int checkVal(int size2);
void putArr(int **&x,const int &s1,const int &s2);
arr[0] = size1;
arr[1] = size2;
}
void summation(int ***&y, int *&arr)
{
int *size = new int;
*size = **y[0] + **y[1];
y[2] = new int *(size);
*(arr + 2) = *size;
delete size;
}
int main()
{
int size, size1, size2;
int size3;
int** x;
int*** y;
int** q;
int**** z;
int *arr[2];
allocArr(x, y, q, z);
checkVal(size);
Input(x, arr, size1, size2);
putArr(x, size1, size2);
summation(y, arr);
display(z);
}
提前谢谢。
这两个函数都有一个int *&arr
参数,而您传入的arr
是int *[2]
,因此参数不匹配。您需要根据要做的操作传入arr[0]
或arr[1]
。
相关文章:
- 函数调用中参数的顺序重要吗
- 基于另一个成员参数将函数调用从类传递给它的一个成员
- 变量没有改变?通过向量的函数调用
- 在两个类中共享相同的函数调用,并在不需要时避免空实例化
- 是否有C++编译器选项允许激进地删除所有函数调用,并将参数传递给具有空体的函数
- 我知道函数调用中存在歧义.有没有办法调用foo()函数
- 模板函数调用
- 获取从C++中同一类中的构造函数调用的方法返回的值
- 析构函数调用
- 成员函数调用和C++对象模型
- 使用共享指针的函数调用,其对象应为 const
- C++:编译时检查匹配的函数调用对?
- 函数调用C++中的参数太少
- 来自 DLL 的函数调用 [表观调用的括号前面的表达式必须具有(指向-)函数类型]
- 返回指向对象的指针的函数调用是否为 prvalue?
- C++ 如何重载 [] 运算符并进行函数调用
- 代码的效率. 转到和函数调用
- 是同一作用域的函数部分中的函数调用
- 如何封装一个函数,以便它只能由同一类中的一个其他函数调用?
- 类型擦除的std::function与虚拟函数调用的开销