fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. union A {
  5. int a;
  6. char b[4];
  7. };
  8. int main() {
  9. A x;
  10. x.a = 10;
  11. for (int i =0;i<4;++i) {
  12. cout << (int) x.b[i] << endl;
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
10
0
0
0