[Error] cannot convert 'int*' to 'int (*)[5]' for argument '6' to 'int Knapsack(int*, int*, int, int, int*, int (*)[5])'
时间: 2024-02-10 10:52:03 浏览: 169
这个错误提示是因为你尝试将一个指向 int 类型的指针传递给一个指向 int 数组的指针参数。这是不兼容的类型。
在调用 Knapsack 函数时,第六个参数需要传递一个指向 int 数组的指针。但是你传递的是一个指向 int 类型的指针。
你需要将第六个参数声明为指向 int 类型的指针,或者将其改为指向 int 数组的指针。具体如何修改要看代码的具体情况。
相关问题
[Error] cannot convert 'int*' to 'PHtTree* {aka HtTree*}' for argument '1' to 'void huffmancodes(PHtTree*, int*, int*, int)'
这个错误是因为你尝试将一个指向`int`类型的指针转换为指向`HtTree`类型的指针,而这是不允许的。
可能的原因是你在调用`huffmancodes`函数时传递了错误类型的参数。请检查你传递给`huffmancodes`函数的第一个参数是否是指向`HtTree`类型的指针,如果不是,请更正该参数。
另外,也请确保你的代码中已经正确定义了`PHtTree`和`HtTree`类型。
[Error] cannot convert 'char*' to 'int*' for argument '2' to 'void addUser(char*, int*, int)'
This error message suggests that there is a function called 'addUser' that expects its second argument to be a pointer to an integer, but instead it is being passed a pointer to a character.
To resolve this error, you need to make sure that the second argument passed to 'addUser' is a pointer to an integer, not a character. You can also check the function definition to make sure that the parameter types match.
阅读全文
相关推荐















