C++"double **"类型的实参与"double *[10]"的形参不兼容,要怎么修改?
voidcreateG(doublea[10][10]){//……赋值}intmain(){int**a;a=newint*[M];for(inti=0;i<M;i++)...
void createG(double a[10][10])
{
//……赋值
}
int main()
{
int ** a;
a = new int *[M];
for (int i = 0; i < M; i++)
a[i] = new int[N];
createG(a);//此处标红
for (int i = 0; i < M; i++)
delete[] a[i];
delete[]a;
} 展开
{
//……赋值
}
int main()
{
int ** a;
a = new int *[M];
for (int i = 0; i < M; i++)
a[i] = new int[N];
createG(a);//此处标红
for (int i = 0; i < M; i++)
delete[] a[i];
delete[]a;
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询