I need to fill a byte array in c language by the possible enumerations.
Here it is how I declare my byte array:
unsigned char byteArray[6];
And now I hesitate if my enumrations should look like MyEnum1
or MyEnum2
:
enum MyEnum1 { A1 = 0, B1 = 1, C1 = 2};
enum MyEnum2 { A2 = 0x00, B2 = 0x01, C2 = 0x02};
The purpose is something like this:
byteArray[0]=A1;
byteArray[1]=B1;
byteArray[2]=C1;
byteArray[3]=A2;
byteArray[4]=B2;
byteArray[5]=C2;
So, is there any recommandations about if my enumerations should contain hexadecimal or integers or another type of data??
Thank you!