#include <bits/stdc++.h>
using namespace std;
int *p;
int main()
{
p = new int;
*p = 1;
printf("%d ",*p);
p = new int;
*p = 2;
printf("%d",*p);
return 0;
}
就比如p是不是找不到存有1的空间的地址了?
#include <bits/stdc++.h>
using namespace std;
int *p;
int main()
{
p = new int;
*p = 1;
printf("%d ",*p);
p = new int;
*p = 2;
printf("%d",*p);
return 0;
}
就比如p是不是找不到存有1的空间的地址了?