C ++错误::没有匹配的函数来调用'function'

新泽西州

我知道这有点补救,但是我似乎无法理解我的问题。它可能与参数中的参数有关,但我不确定。

void Input (int **&x, int *&arr, int &size1,int &size2, int a, int b)
{

    cout << "Please enter 2 non-negative integer values: "<< endl;
    cout << "1. ";
    cin >> size1;
    int checkVal(int size1, int a);
    cout << "2. ";
    cin >> size2;
    int checkVal(int size2, int b);

    void putArr(int **&x,const int &size1,const int &size2);

    arr[0] = size1;
    arr[1] = size2;

}


int checkVal (int &size, int x)
{
    do{
    if (size < 0)
        cout << size << " is not a non-negative integer. Re-enter --> " << x << ". ";
        cin >> size;
    }while(size < 0);

    return size;

}



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 a = 1, b = 2;

    int** x;
    int*** y;
    int** q;
    int**** z;

    int *arr[2];

    allocArr(x, y, q, z);
    Input(x, arr, size1, size2, a, b);
    checkVal(size);
    putArr(x, size1, size2);
    summation(y, arr);
    display(z);


}

所有这三个功能都会出现问题。我很困惑。在此先感谢您。

安东·萨文(Anton Savin)

不用提及目的未知的星星,您在几个地方都有这样的代码:

cin >> size1;
int checkVal(int size1, int a);
cout << "2. ";

在这里,您声明函数checkVal,而不是调用它。在这种情况下,我相信应该将其替换为

cin >> size1;
cout << "2. " << checkVal(size1, a);

(只要您提供正确类型的参数)

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

发生没有匹配的函数来调用C ++中的错误

C ++错误:没有匹配的函数来调用'print_size'

C ++ Boost Geometry错误:没有匹配的函数来调用“ assertion_failed”

C ++错误:没有匹配的函数来调用'simplex615 <arbitraryFunc> :: amoeba

C ++:没有匹配的函数来调用

C ++错误没有匹配的调用函数

c ++:函数“没有匹配的函数可调用”错误

没有匹配的函数来调用'std :: advance'错误

错误:没有匹配的函数来调用“ make_pair”

运算符>>错误:没有匹配的函数来调用

“不是...的成员”和“没有匹配的函数来调用”错误

vscode中的C ++:错误:没有匹配的构造函数来初始化'std :: thread'

C ++-没有匹配的函数来调用'getaddrinfo'

C ++线程-没有匹配的函数来调用

C ++错误没有匹配函数调用静态模板方法

C ++ Lambda-错误:没有匹配的函数可调用

C ++结构错误“没有匹配的调用函数...”

我正在尝试学习如何在c ++中传递指针,但出现错误:没有匹配的函数来调用'test'。我究竟做错了什么?

Qt错误:错误:没有匹配的函数来调用“ QHBoxLayout :: addItem(QPushButton *&)”

为什么出现错误“没有匹配的函数来调用'A(A <... auto ...>)'”?

没有匹配的成员函数来调用“ push_back”错误

为什么我收到 [错误] 没有匹配的函数来调用“car::car()”

使用lambda表达式和std :: function没有匹配的函数调用错误。

C ++没有匹配函数来调用向量push_back

Libtorch C++ - 没有匹配的成员函数来调用 InterpolateFuncOptions 的“size”

C++泛型方法给出“没有匹配的调用函数”错误

C ++中的多线程处理时出现“没有匹配的函数调用”错误

如何编译程序时出现错误“没有匹配的函数调用'to_string'”?C++

C ++类错误信息:没有匹配的调用函数