#include<iostream>
using namespace std;
int main()
{
    int a[5] = { 1,2,3,4,5 };
    int *p = 0;
    cout << "下标运算a[i]:" << "\n";
    for (int x = 0; x < 5; x++)
    {
        cout << a[x];
    }
    cout << "\n指针运算(*p):" << "\n";
    for (p = a; p < &a[5]; p++)
    {
        cout << *p;
    }
    system("pause");
    return 0;
}
Last modification:December 5th, 2018 at 07:19 pm
如果觉得我的文章对您有帮助,请随意赞赏:)