【发布时间】:2012-10-08 15:35:30
【问题描述】:
我的问题与将数组作为 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 的传递参数是一个数组,我想知道是否还有其他方法可以传递这个参数。谢谢!
【问题讨论】:
标签: c++