What kind of variables are better?
#1

Hello, I got confused with something, maybe this is a stupid question but which script of the following ones is better? I'm talking about the memory used due the variables.

pawn Код:
stock FunctionA() {
    new string[128];
    format(string, 128, ...........................);
}

stock FunctionB() {
    new string[128];
    format(string, 128, ...........................);
}

stock FunctionC() {
    new string[128];
    format(string, 128, ...........................);
}

//As you see, I declared 3 variables with 128 cells.
Ok, that's one, what about next one:
pawn Код:
new string[128];

stock FunctionA() {
    format(string, 128, ...........................);
}

stock FunctionB() {
    format(string, 128, ...........................);
}

stock FunctionC() {
    format(string, 128, ...........................);
}

//Just one variable declared.
So, as you saw in the first one I declared 3 variables, and in the second one just one variable. My question is which one is better and why?

Thank you for helping, also, if you give me some reasons about why one of them is better I'll be grateful.

Thank you all!
Reply


Messages In This Thread
What kind of variables are better? - by [DOG]irinel1996 - 04.06.2013, 14:17
Re: What kind of variables are better? - by [DOG]irinel1996 - 04.06.2013, 14:35
Re: What kind of variables are better? - by Universal - 04.06.2013, 14:41
Re: What kind of variables are better? - by [DOG]irinel1996 - 07.06.2013, 12:57

Forum Jump:


Users browsing this thread: 2 Guest(s)