DataStructure期末复习小tips

#include<iostream>
using namespace std;
void main()
{
int i, j;
int s[] = { 1, 2, 3 };
int *temp = new int[5];
temp = s;
for (i = 0; i < 5; i++)
{
cout << temp[i] << endl;
}
temp[3] = 9;
temp[4] = 10;
for (i = 0; i < 5; i++)
{
cout << temp[i] << endl;
}

}

数组首地址和指针的关系?

posted @ 2016-01-01 11:24  Nicolellu  阅读(153)  评论(0)    收藏  举报