【发布时间】:2011-10-26 04:53:24
【问题描述】:
我想声明一个指向矩阵并从矩阵中取回值的指针:
float *p;
float ar[3][3];
[..]//give values to ar[][]
p = ar;
//Keep on printing values in the 3 X 3 matrix
for (int i = 0; i < 10; i++)
{
p = p + i;
cout << *p << ", ";
}
【问题讨论】:
-
如果我应该使用**p指向矩阵ar[][],我怎样才能得到指向矩阵中特定元素的指针的值。