我在互联网上找到了这段代码,想知道它是如何工作的?
int m[10]; //array with 10 elements
for (int i=0; i<10; ++i)
m[i] = i; //simple initializing
int* a = &m[0]; //a - pointer at the first array's element
3[a] = 20; //???
for (int i=0; i<10; ++i)
cout << m[i] << endl;//out
你可以猜到输出是:
0
1
2
20
4
5
6
7
8
9