Raised This Month: $ Target: $400
 0% 

neatest way to have 2 for loops co-exist


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 03-23-2006 , 22:02   neatest way to have 2 for loops co-exist
Reply With Quote #1

which is better
Code:
for ( gi_cvarnum = 0; gi_cvarnum < 80; gi_cvarnum++ )     {         gi_cvar = g_cvars[gi_cvarnum]                 for ( gi_playernum = 0; gi_playernum < gi_playercnt; gi_playernum++ )         {             gi_playerID = gi_players[gi_playernum]
or is this also correct?
Code:
for ( gi_cvarnum = 0; gi_cvarnum < 80; gi_cvarnum++ ) for ( gi_playernum = 0; gi_playernum < gi_playercnt; gi_playernum++ )     {         gi_cvar = g_cvars[gi_cvarnum]                 gi_playerID = gi_players[gi_playernum]
Someone please tell me if both are the same and which one is better to use. I need both conditions to be true and use gi_cvar and gi_playerID together in the same statement following these conditions.
SubStream 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 16:41.


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