25.04.2011, 21:45
(hopefully)
this one doesn't work :O
stock GetHighestNumberEx(num[])
{
new highesty = 0;
for (new i = 0; i<sizeof(num[]);i++)
{
if (num[i] > highesty) { highesty = num[i]; printf("%d > %d",highesty,num[i]); }
}
return highesty;
}
Suposed to loop throught an array to find the highest number. I tried many arrays, but it seems to allways return 0.
any idea why?
this one doesn't work :O
stock GetHighestNumberEx(num[])
{
new highesty = 0;
for (new i = 0; i<sizeof(num[]);i++)
{
if (num[i] > highesty) { highesty = num[i]; printf("%d > %d",highesty,num[i]); }
}
return highesty;
}
Suposed to loop throught an array to find the highest number. I tried many arrays, but it seems to allways return 0.
any idea why?