【发布时间】:2009-11-06 21:03:42
【问题描述】:
我正在尝试查找数组中的最大数。我创建了一个函数,我正在使用以下代码:
int maxValue( int myArray [], int size)
{
int i, maxValue;
maxValue=myArray[0];
//find the largest no
for (i=0;i)
{
if (myArray[i]>maxValue)
maxValue=myArray[i];
}
return maxValue;
}
但是,我在 ) 令牌之前收到语法错误。我做错了什么,我什至做对了吗?任何帮助将不胜感激。
【问题讨论】:
-
您的
forloop 已损坏 - 查看任何有关 C 的书籍或在线教程以了解正确的语法 -
@hollerTrain:你有没有从stackoverflow.com/questions/32920644/c-compare-numbers/… 得到我的代码并以某种方式扭曲它?!
标签: c