fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. typedef union{
  6. long int l;
  7. int a;
  8. char b[4];
  9. }U;
  10.  
  11.  
  12.  
  13. int main() {
  14. // your code goes here
  15. U un;
  16. char bt[8]={'a','b','c','d','e','f','g','h'};
  17. memcpy(un.l,bt,8);
  18. printf("%c", un.b[0]);
  19. printf("%c", un.b[1]);
  20. printf("%c", un.b[2]);
  21. printf("%c", un.b[3]);
  22.  
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout