I have an union X. It's size is 64bits. How can I write (if possible) its declaration if I want to access those 64 bits as:
1. 4 int16_t: p,q,r,s;
2. Array of 4 int16_t: a[4]
3. 2 int32_t: n, m;
4. Array of 2 int32_t: b[2]
5. 1 int64_t z;
开发者_运维百科
something like
union thingie_type {
struct { int16_t p,q,r,s; };
int16_t a[4];
struct { int32_t n,m; };
int32_t b[2];
int64_t z;
};
精彩评论