int ia[3][4];
for (auto p = ia; p != ia + 3; ++p) {
// q points to the first element of an array of four ints; that is, q points to an
for (auto q = *p; q != *p + 4; ++q)
cout << *q << ' ';
cout << endl;
}
这是我照着primer c++ 5th multidimensional array 写的,但是输出的结果中却包含一个'1'
结果:
0 1 0 0
0 0 0 0
0 0 0 0
不太明白这里为什么会有一个'1'呢?
ia
沒有初始化,什麽值都有可能。建議改爲int ia[3][4] = {0};