Raised This Month: $ Target: $400
 0% 

ENUM :O


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
BFK_GoNER
Junior Member
Join Date: Feb 2009
Location: Holland
Old 05-31-2009 , 11:11   Re: ENUM :O
Reply With Quote #5

For instance, you want to define a set of constants belonging to the same group. You could do it this way:

PHP Code:
// Weapon constants:
#define WEAPON_KNIFE     10
#define WEAPON_DEAGLE   20
#define WEAPON_AK47      30
#define WEAPON_AWP       40
#define WEAPON_FLASH    50 
or you could use enum:

PHP Code:
enum (+=10)
{
      
WEAPON_KNIFE 10,
      
WEAPON_DEAGLE,     // will be equal to 20
      
WEAPON_AK47,        // will be equal to 30
      
WEAPON_AWP,        // ... and so on
      
WEAPON_FLASH       // ...

BFK_GoNER 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 13:49.


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