04.07.2012, 13:27
Hmm, in that case you should be fine with strlen, I suppose. Should work as long as you don't have any 0 somewhere in the middle of your element (e.g. 1, 2, 0, 3) as that is regarded as the null terminator and will affect the return of strlen.
Edit: Just tested that, but it does require a null terminator. This will produce the output you're looking for:
pawn Code:
count = strlen(array1[index]); // second element
for( new i; i < count; i++ )
{
//...
}
pawn Code:
new array1[][] = {
{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 }, // there is 9 numbers
{ 1, 2, 3, 4, 5, 0 }, // there is 5 numbers
{ 1, 2, 3, 4, 5, 6, 0 } // there is 6 numbers
};
printf( "%d", strlen(array1[0]) );
printf( "%d", strlen(array1[1]) );
printf( "%d", strlen(array1[2]) );