[ create a new paste ] login | about

Link: http://codepad.org/ktmIMdXZ    [ raw code | output | fork ]

C++, pasted on Aug 28:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
union U {
  struct {
      int x : 1;
      int y : 1;
  } test;
  int z;
} u;

void foo(const int& a){ cout << &a << endl; }

int main() {
 cout << &u.z << endl;
 foo(u.test.x);
 foo(u.test.y);
 return 0;
}


Output:
1
2
3
0x804fe58
0xbf5af858
0xbf5af85c


Create a new paste based on this one


Comments: