fork download
  1. int **arr = new int*[n];
  2. for(size_t i = 0; i!=n; ++i)
  3. arr = new int[m];
  4.  
  5. int **arr = new int*[n];
  6. arr[0] = new int[n*m];
  7. for(size_t i = 1; i!=n; ++i)
  8. arr = arr[i-1] + m;
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:22: error: 'n' was not declared in this scope
 int **arr = new int*[n];
                      ^
prog.cpp:2:1: error: expected unqualified-id before 'for'
 for(size_t i = 0; i!=n; ++i)
 ^
prog.cpp:2:19: error: 'i' does not name a type
 for(size_t i = 0; i!=n; ++i)
                   ^
prog.cpp:2:25: error: expected unqualified-id before '++' token
 for(size_t i = 0; i!=n; ++i)
                         ^
prog.cpp:5:7: error: redefinition of 'int** arr'
 int **arr = new int*[n];
       ^
prog.cpp:1:7: note: 'int** arr' previously declared here
 int **arr = new int*[n];
       ^
prog.cpp:5:22: error: 'n' was not declared in this scope
 int **arr = new int*[n];
                      ^
prog.cpp:6:1: error: 'arr' does not name a type
 arr[0] = new int[n*m];
 ^
prog.cpp:7:1: error: expected unqualified-id before 'for'
 for(size_t i = 1; i!=n; ++i)
 ^
prog.cpp:7:19: error: 'i' does not name a type
 for(size_t i = 1; i!=n; ++i)
                   ^
prog.cpp:7:25: error: expected unqualified-id before '++' token
 for(size_t i = 1; i!=n; ++i)
                         ^
stdout
Standard output is empty