Thread
: [Solved]
When should i use "static" over "new" variable?
View Single Post
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
03-04-2018 , 09:15 Re: When should i use "static" over "new" variable?
#
9
Quote:
Originally Posted by
E1_531G
For example, we have client_prethink() which is executed
every client frame
.
If inside the function you use
new var
, you will have:
1. create var
2. use var
3. delete var (on func end)
If you have
static var
instead:
1. create var (only first call)
2. use var
(never delete on func end)
It doesn't matter.
__________________
AMXXPawn for VSCode
|
AlliedModders Dark Theme
|
Syntax Highlight for [ code ] blocks
In memory of Papa Franku
klippy
View Public Profile
Send a private message to klippy
Find More Posts by klippy