fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Coordinates1
  5. {
  6. Coordinates1():x(v[0]), y(v[1]), z(v[2])
  7. {
  8. }
  9.  
  10. int v[3];
  11. int& x;
  12. int& y;
  13. int& z;
  14. };
  15.  
  16. struct Coordinates2
  17. {
  18. Coordinates2()
  19. {
  20. }
  21.  
  22. int v[3];
  23. };
  24.  
  25. int main() {
  26. cout << sizeof(Coordinates1) << endl;
  27. cout << sizeof(Coordinates2) << endl;
  28. return 0;
  29. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
40
12