04.07.2012, 13:09
pawn Code:
new
array1[ 3 ][ 9 ] = {
{ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, // there is 9 numbers
{ 1, 2, 3, 4, 5, 0, 0, 0, 0 }, // there is 5 numbers
{ 1, 2, 3, 4, 5, 6, 0, 0, 0 }, // there is 6 numbers
}
;
printf( "%d", sizeof( array1 ) );
printf( "%d", sizeof( array1[] ) );
printf( "%d", sizeof( array1[][] ) );
pawn Code:
new
index = 0,
count
;
count = /* somehow count how many numbers there is in element in array. The best way would be "sizeof( array1[ index ]", but it gives errors */
for( new i; i < count; i++ )
{
//...
}