fork download
  1. #include <iostream>
  2.  
  3.  
  4. struct GoB_Sensor
  5. {
  6. int id = 0;
  7. };
  8.  
  9. int main()
  10. {
  11. GoB_Sensor mySensor;
  12.  
  13. mySensor.id = 1;
  14.  
  15. GoB_Sensor sensorArray[1];
  16.  
  17. std::cout << sensorArray[0].id << std::endl;
  18.  
  19. sensorArray[0] = mySensor;
  20.  
  21. std::cout << sensorArray[0].id;
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0.01s 5296KB
stdin
Standard input is empty
stdout
0
1