fork download
  1. #include <stdio.h>
  2.  
  3. typedef struct Expected {
  4.  
  5. const int number;
  6. const char operand;
  7.  
  8. } Expected;
  9.  
  10.  
  11.  
  12. int main(void) {
  13. Expected array[1];
  14. Expected e = {1, 'c'};
  15. array[0] = e;
  16. printf("%d\n", array[0].number);
  17. return 0;
  18. }
  19.  
Compilation error #stdin compilation error #stdout 0s 9424KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:15:10: error: assignment of read-only location ‘array[0]’
 array[0] = e;
          ^
stdout
Standard output is empty