25.04.2011, 21:59
Your sizeof won't work like that, I was able to fix it by adding an additional parameter called size which defaults to the size of the first parameter using sizeof, tested and it works fine.
Tested with:
Hope that helps
pawn Код:
stock GetHighestNumberEx(num[], size = sizeof(num))
{
new highesty = 0;
for (new i = 0; i < size; i++)
{
if (num[i] > highesty) { highesty = num[i]; printf("%d > %d",highesty,num[i]); }
}
return highesty;
}
pawn Код:
new array[] = {1,4,2,1,4,55,242,2,1,4,22};
printf("Highest is %d", GetHighestNumberEx(array));

