65,211
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
using namespace std;
int main()
{
int *p = new int;
*p = 10;
int *pp = new int;
*pp = 50;
*p = 10;
cout << "*pp = " << *pp << '\n';
cout << "*p = " << *p << '\n';
return 0;
}
输出:
*pp = 50
*p = 10
void main()
{
int *p=new int;
*p=10;
int *pp=new int;
*pp=50;
*p=20;
cout <<"*pp=" <<*pp<<endl;
cout <<"*p=" <<*p<<endl;
}