From string to Enum variable
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
That is incorrect. While the name of the enum is indeed a constant, its value is the value of the last constant + 1. Therefore if you have something like this:
PHP код:
enum eMyEnum (<<= 1) {
    
VAR_A 1,
    
VAR_B// this will be 2
    
VAR_C // this will be 4

Then eMyEnum will be 5.
Yes I was not quite awake when I wrote that
Reply


Messages In This Thread
From string to Enum variable - by PeanutButter - 20.01.2017, 23:13
Re: From string to Enum variable - by AmigaBlizzard - 20.01.2017, 23:23
Re: From string to Enum variable - by iLearner - 20.01.2017, 23:43
Re: From string to Enum variable - by Dutheil - 21.01.2017, 06:16
Re: From string to Enum variable - by Vince - 21.01.2017, 09:41
Re: From string to Enum variable - by Dutheil - 21.01.2017, 09:51

Forum Jump:


Users browsing this thread: 1 Guest(s)