stock/const/static/new array
#1

Which is best to use?

pawn Код:
new array[][3] = {
{1.0, 2.0, 3.0},
{4.0, 5.0, .0}
};
static?
stock?
const?

Please only reply if you know what you're talking about. I want to know which one is more efficient to use.
Reply
#2

Well in theory you can use all 3 at the same time.
pawn Код:
static const stock gMyArray[3] = {1, ...};
Static declares a variable to that file only, it is invisible for all other files (for an include, maybe). Const declares the variable as constant, this means you cannot modify it (accidentally) with code (useful for arrays of coordinates that never change). Stock tells the compiler to ignore the variable if it is never referred to in the code.

More details, as said, in pawn_lang.pdf
Reply
#3

What I mean is, which will use less space?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)