Hello,
I try to make integer type that will be always 32 bit wide, independent of the underlying hardware.
Because char is always 1 byte we could arrange four chars in some way to form integer varaiable. The question is how?
My first attempt:
but this require initialization with curly braces:Code:typedef struct type32 {int a:32;} myInt_t;
Typedef consisting of a struct with char array has the same problem - initialization:Code:myInt_t a = {11};
How to solve this problem?Code:typedef struct {char a[4];} myInt_t;