fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdint.h>
  4.  
  5. typedef union array_
  6. {
  7. uint16_t word;
  8. struct {
  9. uint8_t lo;
  10. uint8_t hi;
  11. };
  12. } array[32];
  13.  
  14.  
  15. int main()
  16. {
  17. array a = { 0x2345, 0x6789, 0xabcd };
  18.  
  19. printf("%02x -- %02x\n", a[0].lo, a[0].hi);
  20. }
  21.  
  22.  
Success #stdin #stdout 0s 4996KB
stdin
Standard input is empty
stdout
45 -- 23