fork download
  1. #define DIM 9
  2.  
  3. inline int& mask(int x, int y) { return MaskA[y][x]; }
  4. inline int& label(int x, int y) { return LabelA[y][x]; }
  5.  
  6. void main()
  7. {
  8. int MaskA[DIM][DIM];
  9. int LabelA[DIM][DIM];
  10. int total=5;
  11. init(total);
  12. }
  13.  
  14. void init(int total) {
  15. for (int y = 0; y < DIM; y++)
  16. for (int x = 0; x < DIM; x++) {
  17. mask(x, y) = 9;
  18. label(x, y) = 0;
  19. }
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int& mask(int, int)’:
prog.cpp:3:41: error: ‘MaskA’ was not declared in this scope
 inline int& mask(int x, int y) { return MaskA[y][x]; }
                                         ^~~~~
prog.cpp:3:41: note: suggested alternative: ‘mask’
 inline int& mask(int x, int y) { return MaskA[y][x]; }
                                         ^~~~~
                                         mask
prog.cpp: In function ‘int& label(int, int)’:
prog.cpp:4:42: error: ‘LabelA’ was not declared in this scope
 inline int& label(int x, int y) { return LabelA[y][x]; }
                                          ^~~~~~
prog.cpp:4:42: note: suggested alternative: ‘label’
 inline int& label(int x, int y) { return LabelA[y][x]; }
                                          ^~~~~~
                                          label
prog.cpp: At global scope:
prog.cpp:6:11: error: ‘::main’ must return ‘int’
 void main()
           ^
prog.cpp: In function ‘int main()’:
prog.cpp:11:5: error: ‘init’ was not declared in this scope
     init(total);
     ^~~~
prog.cpp:11:5: note: suggested alternative: ‘int’
     init(total);
     ^~~~
     int
stdout
Standard output is empty