14.10.2013, 18:27
(
Последний раз редактировалось Slice; 14.10.2013 в 20:08.
)
Today I learned that you can do some numeric operations on arrays, which alters the address given. So far I haven't found anything useful with it, but you can do this:
Edit:
This could be used to make pointers:
The only remaining problem is runtime BOUNDS checks, which can be NOPed at startup!!
BTW, thanks to Emmet_ for accidentally find this: http://forum.sa-mp.com/showthread.ph...20#post2738320
pawn Код:
print(-~~-"hello");
This could be used to make pointers:
pawn Код:
stock g_ptrarr[1000];
#define @ptr[%1] \
(!~g_ptrarr)[%1 / 4]
main() {
new address = ref("hello"); // ref gets the address of the argument
print(@ptr[address]);
}
BTW, thanks to Emmet_ for accidentally find this: http://forum.sa-mp.com/showthread.ph...20#post2738320