Gforse Gforse - 3 months ago 13 Question

Converting C++ #Define enum creation to

For a project i need to a Enum list writen in C++ converterd to en Enum list. So far everything is OK except for the #define enums that are in the C++ list. Here's what i whant to convert:

typedef enum
#define EnumValue(a,b) a, b=a+255
} ID;

As you can see this creates 255 enums values at runtime. How is this done in

EDIT / SOLVED 30-09-2016

As mentioned below i made the wrong assumption by thinking it would create 255 enums, instead it creates just two enums however given
an extra offset of 255. Meaning: if i have a three enums, the index of these enums are 0,1,3. Now if i want the index of
to begin at 10 i just add
ENUM_2 + 8
this way ENUM_3 will start at index 10.

Thanks all for responding so fast and helping me out! :-)


The VB equivalent is:

Public Enum ID
End Enum

Not 255 values as you stated, but just 2.