fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int mat[10][5] = { {0} };
  6.  
  7. cout << mat[9] << endl;
  8.  
  9. int *ptr = mat;
  10.  
  11. cout << ptr[9] << endl;
  12.  
  13. return 0;
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:9:13: error: cannot convert ‘int (*)[5]’ to ‘int*’ in initialization
  int *ptr = mat;
             ^~~
stdout
Standard output is empty