3d array
#9

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Well, duh! That's why enumerators are commonly used for the last dimension, if it worked by simply placing a consecutive number there, then there would be no use for enumerators being used with arrays (in this particular scenario). Simple arrays like that behave that way so you can access individual cells; otherwise, you could only retrieve the whole set of characters.

That's also why the size of enumerators with elements that have more than one cell are always larger than the actual number of columns (counting by 1).

And the reason behind doing enum_name:1, enum_name:2, etc. in the index where the enumerator was placed when declaring the array as an alternative to not use the name of the elements in the enumerator.

I was only explaining to the thread author regarding to why a 3rd dimension isn't needed. But I get where you are coming from since I used 'column', it technically defines the column if you insert the right index, but I guess I could have used 'cell' instead.

-----



I'm not sure what method you are talking about, but this is the most common one:

pawn Код:
enum e_array
{
    string[144],
    integer
};

new array[][e_array] =
{
    {"hello buddy", 5000},
    {"something", 2000}
};

main()
{
    printf("%s %d", array[0][string], array[0][integer]);
}
This is really basic (I see people that are new to PAWN even create arrays this way), I thought you knew about it already. So I just felt the need to point out why a 3rd dimension isn't needed.
Yes, I'm using that one. Actually I never used any arrays like this so this was the first time I had to do something like this.
Reply


Messages In This Thread
3d array - by GoldenLion - 03.01.2017, 22:55
Re: 3d array - by IstuntmanI - 03.01.2017, 23:07
Re: 3d array - by GoldenLion - 03.01.2017, 23:37
Re: 3d array - by SickAttack - 04.01.2017, 00:01
Re: 3d array - by GoldenLion - 04.01.2017, 00:47
Re: 3d array - by IstuntmanI - 04.01.2017, 01:23
Re: 3d array - by GoldenLion - 04.01.2017, 01:52
Re: 3d array - by SickAttack - 04.01.2017, 15:45
Re: 3d array - by GoldenLion - 04.01.2017, 16:21

Forum Jump:


Users browsing this thread: 1 Guest(s)