Raised This Month: $ Target: $400
 0% 

Arrays (Better coding methods) Expirenced programmers only


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 04-04-2006 , 18:40  
Reply With Quote #4

Quote:
Originally Posted by Lord of Destruction
how about Method #4: The solution for really experienced coders

Code:
enum CPlayer {   pKills,   pDeaths,   pName[ 32 ] }; new g_PlayerStuff[ 33 ][ CPlayer ]; // ... console_print(0 , "%s has %d kills and %d deaths", g_PlayerStuff[ id ][ pName ], g_PlayerStuff[ id ][ pKills ],  g_PlayerStuff[ id ][ pDeaths ] );
Which is EXACTLY the same as the other methods, except its harder to understand at a glance, and also contains a bit of unnessasary information (the name).

Honestly, for such a simple thing, using an enum is not useful or faster.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
 



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:37.


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