Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2-dimensional arrays in enum #120

Closed
justnonamenoname opened this issue Nov 10, 2016 · 1 comment
Closed

2-dimensional arrays in enum #120

justnonamenoname opened this issue Nov 10, 2016 · 1 comment

Comments

@justnonamenoname
Copy link

justnonamenoname commented Nov 10, 2016

as title says

я могу проспонсировать, вопрос цены?

@YashasSamaga
Copy link
Member

YashasSamaga commented Feb 11, 2017

enum E_ENUM
{
       Money, // value = 0
       Score,   // value = 1
       AdminLevel, //value = 2
       Name[24], //value = 3
       Wanted Level, //value = 27
       TwoDArray[5][5], // value = 28
       NextVar, //value = must be 58, the extra 5 cells to store the address array for TwoDArray
}
new EnumArray[500][E_ENUM]; //E_ENUM gives the total size

EnumArray[0][Score] = 0; //is as good as EnumArray[0][1]

EnumArray[0][TwoDArray][2][2] //problem

The problem is that PAWN does not store 2D arrays like 1D array (C/++ style arrays). It stores 2D arrays by storing the addresses of the sub arrays in an array (it is explained here)

@Southclaws Southclaws changed the title 2-dimensional arrays in enum [suggestion] 2-dimensional arrays in enum Jan 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants