Size of a dimension
#1

I'm wondering how to get the size of some other variable dimension, not first. So for example lets say I do:
Код:
new string[3][128];
that will obviously create me 3 "string" called variables with a size of 128 cells, each. So I want to get the size of the string[0], and it should be 128, but I'm unable to. I'm only able to get the size of the root "string" variable (size = 3). Currently I am doing
Код:
sizeof(string[0])
but it just won't compile.

Any solutions?
Reply
#2

I don't know if this is what you meant, but trying adding it with a loop:
pawn Код:
for(new i = 0; i < sizeof(string[0])-1; i++)
{
//Code or something
}
Just using sizeof, with -1 to go through all of it.

Edit: l33t Luka.
Reply
#3

You didn't got me. I'm trying to get the size of string[0] using sizeof(string[0]) but I'm unable to, it wont compile. You can get the size only of the "string" - sizeof(string), but not any additional dimension like string[0], string[1], etc.
Reply
#4

BUMP! Anyone got the solution?
Reply
#5

OH your trying to get the size of a string, like string[1], string[2], string[3] ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)