Submatrix sum code

i am unable to understand the code written under int main of this video and use of double pointers in the sum function.

@aditi2512201012019
hello Aditi,
In main function, sir is allocating 2d array dynamically

read more about it here ->
https://www.techiedelight.com/dynamic-memory-allocation-in-c-for-2d-3d-array/

but aren’t we already declaring 2d array a[ ][ ] in int ,then why it is required to do this thing.

@aditi2512201012019

here in main function we have declared it dynamically.

is it necessary to do this dynamically.

or we can do it otherwise also?

@aditi2512201012019
No not necessary, u can use a static 2d array .

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.