fork download
  1. #include <iostream>
  2.  
  3. struct
  4. {
  5. int edit_D_L_1;
  6. int edit_D_L_2;
  7. int edit_D_L_3;
  8. int edit_D_L_4;
  9. } RemoteXY;
  10.  
  11. int * const arrayOfVariables[] =
  12. {
  13. &RemoteXY.edit_D_L_1,
  14. &RemoteXY.edit_D_L_2,
  15. &RemoteXY.edit_D_L_3,
  16. &RemoteXY.edit_D_L_4,
  17. };
  18.  
  19. int main()
  20. {
  21. RemoteXY.edit_D_L_1 = 12;
  22. RemoteXY.edit_D_L_2 = 34;
  23. RemoteXY.edit_D_L_3 = 56;
  24. RemoteXY.edit_D_L_4 = 78;
  25.  
  26. for (size_t i = 0; i < 4; i++)
  27. {
  28. printf("%d\n", *arrayOfVariables[i]);
  29. *arrayOfVariables[i] = i * 10;
  30. }
  31.  
  32. printf("%d\n", RemoteXY.edit_D_L_1);
  33. printf("%d\n", RemoteXY.edit_D_L_2);
  34. printf("%d\n", RemoteXY.edit_D_L_3);
  35. printf("%d\n", RemoteXY.edit_D_L_4);
  36.  
  37. return 0;
  38. }
Success #stdin #stdout 0s 4300KB
stdin
Standard input is empty
stdout
12
34
56
78
0
10
20
30