Raised This Month: $ Target: $400
 0% 

Static vs New


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
PartialCloning
Senior Member
Join Date: Dec 2015
Old 12-06-2015 , 20:19   Static vs New
Reply With Quote #1

I know this topic has been discussed many times and I did read about it, but I still don't understand the main difference on the lowest level.

Code:
static i;
for(i = 1; i <= 10; i++)
Code:
for(new i = 1; i <= 10; i++)
From my understanding, in the first case the value always remains in the memory, while in the second case it's removed as soon as it's not being used. Wouldn't that make 'new' better than 'static' in most cases? Besides when you need to hold the value? Or is the part that 'new' originally held no longer reusable?
PartialCloning is offline
 


Thread Tools
Display Modes

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 18:10.


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