fork download
  1. #include <stdio.h>
  2. #include <stdint.h>
  3.  
  4. enum { STATE_IDLE = 0, STATE_WORKING, STATE_PANIC, TOTAL_STATES };
  5. int32_t const g_stress_levels[TOTAL_STATES] = {
  6. [STATE_IDLE] = 10,
  7. [STATE_WORKING] = 40,
  8. [STATE_PANIC] = 90
  9. };
  10.  
  11. int main(void) {
  12. printf("%d\n", g_stress_levels[STATE_IDLE]);
  13. printf("%d\n", g_stress_levels[STATE_WORKING]);
  14. printf("%d\n", g_stress_levels[STATE_PANIC]);
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 2112KB
stdin
Standard input is empty
stdout
10
40
90