In my code, it only allocating memory for one matrix. When I try to allocate memory for two matrices here just two columns of memory are allocating and there is no other chance to allocate memory for the second matrix.
Here is my Code
    void 2DArray()
     {
         int noOfRows, noOfColumns, noOfMatrices;
         printf("\n\n ENTER THE NUMBER OF  MATRICES YOU WANT TO ADD : ");
         scanf("%d",&noOfMatrices);
         int **2DArray = (int**)malloc((noOfMatrices * sizeof(int)));
         for(int i = 0; i < noOfMatrices; i++)
          {
                  2DArray[i] = (int*)malloc((sizeof(int) * noOfRows));
          }
     }
Please help me!
 
     
    