C ++:函数调用中的参数太少 [英] C++: too few arguments in function call
本文介绍了C ++:函数调用中的参数太少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在此代码中有问题.当我调用函数时.编译器显示此错误:
i have problem in this code. when i call functions. compiler show this error:
函数调用中的参数太少"........................................................
"too few arguments in function call" ............................................................
bool check_matrix(int x, int y){
if (x<ROWS || y<COLUMNS)
return true;
return false;
}
bool compute_duplicate(int x, int y, int array[], int array_length){
for (int i=0; i< array_length; i++)
{
if(array[i]==compute_address(x,y))
return false;
}
return true;
}
////////////////////////////////////
for (int i=0; i<array_length; i++){
if ((check_matrix(x,(y+1))==true) && compute_duplicate((x,(y+1), array, array_length)==false)) {
array[i]= compute_address(x,(y+1));
y++;
d++;
i++;
}
if ((check_matrix((x+1),y)==true) && compute_duplicate((x+1),y, array, array_length)==false)) {
array[i]=compute_address((x+1),y);
x++;
d++;
i++;
}
array_length=d;
}
推荐答案
以下函数调用的放错了括号
The following function call has a misplaced bracket
compute_duplicate((x,(y+1), array, array_length)==false)
应该是
(compute_duplicate(x,(y+1), array, array_length)==false)
循环中的两个地方都存在相同的错误.
the same error exists in two places within your loop.
这篇关于C ++:函数调用中的参数太少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文