#include
using namespace std;
int main() {
int n,m;
cin>>n>>m;
int arr = new int[n];
for(int i=0;i<n;i++) {
arr[i] = new int[m];
}
for(int i=0;i<n;i++) {
for(int j=0;j<n;j++) {
cin>>arr[i][j];
}
}
return 0;
}
error is
‘int*’ in initialization
int arr = new int[n];
^
subarr.cpp:8:18: error: invalid conversion from ‘int*’ to ‘int’ [-fpermissive]
arr[i] = new int[m];
^~~~~~~~~~
subarr.cpp:13:26: error: invalid types ‘int[int]’ for array subscript
cin>>arr[i][j];
^