I dont understand the mainfunction

int main(int argc, char const *argv[])
{

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 < m; j++)
	{
		cin >> arr[i][j];
	}
}
cout << sumofSubmatrix(arr, n, 

m) << endl;
return 0;
}
Here I dont understand the array declaration in the form of pointers…

hello @bnikhilsai1998
we are declaring our array dynamically.

if u r not aware of it then pls read it.

static allocation will also work fine.
so u can replace these lines

with
int arr[n][m];

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.