05.07.2012, 08:41
pawn Code:
// array
new
Float:array1[ ][ ] = {
{ 1.1, 9.8, 2.5, 0.0 }, // there is 3 numbers
{ 1.6, 5.1, 0.0 }, // there is 2 numbers
{ 1.2, 5.3, 6.0, 5.3, 0.0 } // there is 4 numbers
}
;
// function
stock len( Float:array[ ] )
{
new
i = 0,
count
;
while( array[ i ] != 0.0 )
{
count++;
i++;
}
return count;
}
// printing
printf( "%d", len( array1[ 0 ] ) );