I have this Hexadecimal enumeration of 8 bytes:
enum MyEnum
{
OPTION_1 = 0x000000;
OPTION_2 = 0x000001;
};
Is there any way to add OPTION_1
to the following pointer (this pointer will contain other binary data):
unsigned char* MyArray; // bytes array
EDIT I appologize for the unclear expression of "to add". Well, if I had
enum MyEnum
{
OPTION_1 = 0x00;
OPTION_2 = 0x01;
};
Then the values are of this enum are of size 1 byte. And so after memory allocation of the pointer, I can simply assign as follows:
MyArray[0]=OPTION_1;
But now, the problem is that OPTION_1 is of size 8 bytes and not 1 byte. And so I can't do that simple assignment.
I should have for assignments, but I don't know the values:
MyArray[0]=?; // copy the first byte of OPTION_1
MyArray[1]=?; // copy the second byte of OPTION_1
MyArray[2]=?; // ...
MyArray[3]=?; // ...
MyArray[4]=?;
MyArray[5]=?;
MyArray[6]=?;
MyArray[7]=?;
Thank you a lot!