1. 指针可以操作数组元素
#include <iostream>
using namespace std;
int main()
{
int a[5] = {1, 2, 3, 4, 5};
int *p = &a[2];
cout << p[1] << ' ' << p[-2] << endl;
}
2.
|
1. 指针可以操作数组元素 #include <iostream>
using namespace std;
int main()
{
int a[5] = {1, 2, 3, 4, 5};
int *p = &a[2];
cout << p[1] << ' ' << p[-2] << endl;
}
2.
|