18.08.2016, 14:19
Yes. An enumeration defines a set of constants. It is actually very similar to doing:
Although the enumeration is obviously much easier to construct since you don't have to perform any calculations yourself.
PHP код:
#define pName 0 // start at index 0 and reserve another 23 indices
#define pPassword 24 // start at slot 24 and reserve another 64 indices
#define pSalt 88 // start at index 88 and reserve another 10 indices
#define pInfo 98 // total number of indices + 1
new PlayerInfo[MAX_PLAYERS][pInfo];