fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Point {
  5. int x,y ;
  6. };
  7. Point points[3] {{1,2},{3,4},{5,6}};
  8. int x2 = points[2].x;
  9.  
  10. struct Array {
  11. Point elem[3];
  12. };
  13.  
  14. int main() {
  15. cout << "!!!\nStructure!!!" << endl;
  16.  
  17. Array points2 {{{1,2},{3,4},{5,6}}};
  18. int y2 = points2.elem[2].y;
  19.  
  20. cout << "!!!here points2 = !!!" << y2 <<endl;
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
!!!
Structure!!!
!!!here points2 = !!!6