方式一:

#include <stdio.h>
#include <stdlib.h>
void main()
{
    int m = 4, n = 3;
    int **myArray;
    myArray = (int**) malloc (m * sizeof(int*));
    for(int t = 0; t < m; t++)
        myArray[t] = (int*) malloc (n * sizeof(int));
    for(int t = 0; t < m; t++)
    {
        free(myArray[t]);
    }  
    free(myArray);
    return;
}

方式二:

#include <stdio.h>
#include <stdlib.h>
void main()
{
    int m = 4, n = 3;
    int** myArray, **_myArray;
      
    myArray = _myArray = (int**) malloc (m * sizeof(int*));
    for(int t = 0; t < m; t++)
        *_myArray++ = (int*) malloc (n * sizeof(int));
      
    for(int t = 0; t < m; t++)
    {
        free(myArray[t]);
    }  
    free(myArray);
    return;
}