fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct key
  5. {
  6. int x;
  7. int y;
  8. };
  9.  
  10. struct myClass
  11. {
  12. key theKeys[9];
  13. void setup();
  14. };
  15.  
  16. void myClass::setup()
  17. {
  18. for (int i = 0; i < 9; i++)
  19. {
  20. theKeys[i].x = i;
  21. theKeys[i].y = i - 1;
  22. cout << theKeys[i].x << " " << theKeys[i].y << endl;
  23. }
  24. }
  25.  
  26. int main()
  27. {
  28. myClass x;
  29. x.setup();
  30. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
0 -1
1 0
2 1
3 2
4 3
5 4
6 5
7 6
8 7