C Create Dynamic 2D array

In my last post, I create code to create 2D array in C++. Now, I try to create dynamic 2D array in C. Algorithm to create dynamic 2D array in C or C++ is same. This is a code to create dynamic 2D array in C :

After you create dynamic 2D array in C, you can use this code to free 2D array in C :

C++ create 2D array

How to create dynamic 2d array in C++ ?
This is a code to create 2D array in C++ :

If you want to remove or free array 2D, you can use this code :