01.08.2012, 12:26
Okay, I'm making a SII/MYSQL based saving + admin system and I'm optimizing the code now.
So, I want to know some stuff:
What is the difference between new and static? Which one should be used to set global variables and which should be used to get names and etc.?
+ Is there an easier way to create strings instead of creating static fuckedString[CELLSIZEHERE];? Like a simpler way which would be more effective.
I'm trying to make a really efficient system so I need to know the following ^^.
Basically:
would this be efficient
OR
better?
AND
is
BETTER OR
So, I want to know some stuff:
What is the difference between new and static? Which one should be used to set global variables and which should be used to get names and etc.?
+ Is there an easier way to create strings instead of creating static fuckedString[CELLSIZEHERE];? Like a simpler way which would be more effective.
I'm trying to make a really efficient system so I need to know the following ^^.
Basically:
would this be efficient
pawn Код:
// On the top of the script
new GlobalString[220];
// Under some function or cmd
format(GlobalString, sizeof(GlobalString), "SHITHERE %d %d", crap, crap);
pawn Код:
// In all functions and cmd
new gString[120];
format(gString, sizeof(gString), "CRAP CRAP CRAP");
AND
is
pawn Код:
// Below every function/cmd
new gString[120];
format(gString ... );
pawn Код:
static gString[120];
format(gString ... );