我只是有一个非常快速的问题,问你们所有人。我一直有在我的C代码,它说:错误:Void值不被忽略,因为它应该是,C编程
error: void value not ignored as it ought to be
在我的代码的情况是在调用语句,以使函数运行
m = myMax1(a,len,m);
的问题和功能问题这是来自无效,如下所示:
void myMax1(int *arr, int *max, int n)
{
max = arr[0];
for(n = 0; n < max; n++)
{
if(arr[n]>max)
{
max = arr[n];
}
}
}
如果您有任何解决方案,请让我知道!非常感谢你!
你分配功能myMax1与M的回归,但这个函数不返回任何东西。 – Monfico
'max = arr [0]','n max','max = arr [n]' - 这些表达式都没有意义。如果在函数内部传递'n',传入的值被'n = 0'破坏,那么从外部传递'n'的意义何在? –
AnT