My question is to point to chunks of memory with an odd size.
Let's say I have structone declared like this:
typedef struct{
int32 val1 : 29;
int32 val2 : 26;
char val3;
}MyStruct;
Suppose that declaring certain bit fields in a structure is desirable (why we will use bit fields is not a question).
If I wanted to declare a pointer pointing to one of these fields, I could try something like this:
MyStruct test;
int32 *myPtr = &(test.val1);
Except that this leads to an error, "receiving a bit field address is not allowed."
Assuming we want, is there a way to point to these fields this way? I know that C ++ is likely to put the fields in the next byte (which will be 32 bits in this case).
source
share