#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;
}
}
数组首地址和指针的关系?
时间: 2024-10-10 07:05:34