Is a global string var better then smaller ones?
#1

Hello there, I was just curious about this one simple question I can't seem to figure out. I was discussing with Calgon about what would be better (in this case for code optimization). What I did was in my script, I created a large variable only for strings.
pawn Код:
new str[1024]; // This is also used for dialogs just saying (I know max is 128 for normal strings).
That is a global variable, that I put somewhere above/near the #include/#defines.

Now, that is all I use for string variables 1 var, globally. And I can't tell if declaring smaller string variables are better then global ones.

Imagine having to create small variables under every callback/function you use
pawn Код:
new str[128];
Please help me figure this out.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)