Raised This Month: $ Target: $400
 0% 

difference between new and static?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-25-2012 , 07:36   Re: difference between new and static?
Reply With Quote #8

Do :
static hj = 0 to be sure of initialization.

For an array, prefer to use a global array, especially if you gonna increment cells :

new g_MyGlobalEntArray[512];


You can consider a static variable like a global variable but that you can access only in 1 function.

Also, as said GordonFreeman, prefer static when your function is called very often, and especially when variables are strings.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode