Raised This Month: $ Target: $400
 0% 

Rank in a for loop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 07-15-2010 , 20:07   Re: Rank in a for loop
Reply With Quote #6

Quote:
Originally Posted by ot_207 View Post
Because it is inefficient.
By adding new to a for loop you basically delete and realloc memory for every cycle.
It is just a use of CPU for something that can be avoided or something useless.
Ex:
PHP Code:
for (new i=0;i<500;i++)
{
  new 
x;

Means:

PHP Code:
// 500 times alloc and reloc
for (new i=0;i<500;i++)
{
  
alloc memory x;
// code
  
delete memory x;

oh ofc, i misunderstood hes sentence, yes im aware of that :p
__________________
I am out of order!
grimvh2 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:10.


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