Raised This Month: $51 Target: $400
 12% 

Creating static inside loop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 06-13-2014 , 18:22   Creating static inside loop
Reply With Quote #1

Code:
for ( new i ; i < gSayCmdCount ; i++ ) {     static TempString2[32]; }
vs.
Code:
static TempString2[32]; for ( new i ; i < gSayCmdCount ; i++ ) { }
Is there a difference or will it only do stuff the first time, when it is initialized?
I thought about using this to prevent wasting that (32 CELLS!!!! of) memory unless there actually is a count. But if it comes at the cost of CPU load it's useless.
__________________
Black Rose is online now
 



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 15:45.


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