我的问题是关系到传递一个数组为C++函数参数。首先,让我展现例如:
void fun(double (*projective)[3])
{
for(int i=0; i<3; i++)
for(int j=0; j<3; j++)
{
projective[i][j]= i*100+j;
}
}
int main()
{
double projective[3][3];
fun(projective);
for(int i=0; i<3; i++)
{
cout<<endl;
for(int j=0; j<3; j++)
cout<<projective[i][j]<<" ";
}
return 0;
}
在这个例子中,对于fun
传球参数是一个数组,我想知道是否有经过这种说法的其他方式。谢谢!