01.08.2012, 12:38
You can't quite compare GlobalString with gString, because - well, one is available globally, and second one is only in local scope. You can accidentaly leak some data you don't want to share between functions. Local variables are destroyed once out of scope, so it won't give you some performance ultraboost.
You'll get:
Variable created with new is destroyed just after it's not in scope.
pawn Код:
for(new i = 0; i < 5; ++i) {
new j = 0;
static k = 0;
printf("Value of new: %d, value of static: %d", j, k);
k++, j++;
}
Quote:
Value of new: 0, value of static: 0 Value of new: 0, value of static: 1 Value of new: 0, value of static: 2 Value of new: 0, value of static: 3 Value of new: 0, value of static: 4 |