C++中动态二维数组赋值运行出现问题

#include<stdio.h>
int main()
{

int m;
int n;
int rows,columns;
int **array2D;
array2D=new int*[m];
for(int i=0;i<m;i++)
{
    array2D[i]=new int[n];
}
printf("Please input the number of rows you want to set as the length of your array\n");
scanf("%d",&rows);
printf("Please input the number of column you want to set as the width of your array\n");
scanf("%d",&columns);
printf("Please input %d numbers to set as the content of your array\n",rows*columns);
for(int m=0;m<=rows-1;m++)
{
    for(int n=0;n<=columns-1;n++)
    {
        scanf("%d",&array2D[m][n]);
    }
}
for(int i=0;i<=m;i++)
{
    delete array2D[i];
}
delete array2D;
return 0;
 

}
运行结果:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc


Process exited after 3.181 seconds with return value 3
请按任意键继续. . .

程序逻辑混乱。
m,n是局部变量,你初始化了吗?如何初始化的?为什么向操作系统申请一个没有明确大小的数组array2D=new int*[m];?你确定m及后面的n是你想要的值?