fork download
  1.  
  2. #include<stdio.h>
  3. union u
  4. {
  5. int var;
  6. unsigned char str[4];
  7. };
  8. int main()
  9. {
  10. unsigned char tmp;
  11. union u uObj;uObj.var = 3;
  12. tmp = uObj.str[1];
  13. uObj.str[1] = uObj.str[0];
  14. uObj.str[0] = tmp;
  15. printf("%d", uObj.var);
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
768