06.02.2014, 03:09
I know this topic is about GDK, but this is kinda related to.
I was trying to find out how multidimentional arrays works in the interation pawn/(c++ || c). All i got now, is the code below, which is not working for some reason.
Any help is appreciated,Thanks.
pawn
c++
I was trying to find out how multidimentional arrays works in the interation pawn/(c++ || c). All i got now, is the code below, which is not working for some reason.
Any help is appreciated,Thanks.
pawn
PHP код:
native Test(string[][],size = sizeof string,size2 = sizeof string[]);
main()
{
new id[2][2];
printf("Pawn");
for(new i = 0; i < sizeof id; ++i)
{
for(new k = 0; k < sizeof id[]; ++k)
{
printf("id[%d][%d]= %d",i,k,k);
id[i][k] = k;
}
}
printf("End Pawn");
Test(id);
}
PHP код:
cell AMX_NATIVE_CALL Test(AMX* amx, cell* params)
{
logprintf((char*)"c++");
cell *addr;
int extra = 4;
amx_GetAddr(amx, params[1], &addr);
for(int i = 0; i < params[2]; i++)
{
for(int k = 0; k < params[3]; ++k)
{
logprintf((char*)"Array[%d]=%d",i, *(addr + extra));
extra += 4;
}
}
logprintf((char*)"End");
return 1;
}