1 a=new int*[n+1]; 2 for (i=0;i<=n;i++) 3 a[i]=new int[m+1]; 感觉比malloc好用。 动态初始化后,值并非全为0,注意! 转载于:https://www.cnblogs.com/cmyg/p/9836003.html