fork(2) download
  1. struct Vector2f {
  2. float x, y;
  3. };
  4.  
  5. struct Rect {
  6.  
  7. union {
  8. Vector2f pos;
  9. struct {
  10. float x,y;
  11. };
  12. };
  13. union {
  14. Vector2f size;
  15. struct {
  16. float width, height;
  17. };
  18. };
  19.  
  20. };
  21.  
  22. #include <iostream>
  23. using namespace std;
  24. int main() {
  25.  
  26. Rect rect;
  27. rect.x = 10;
  28. rect.y = 20;
  29. cout << rect.pos.x << " " << rect.pos.y << endl;
  30.  
  31. }
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
10 20