64,647
社区成员
发帖
与我相关
我的任务
分享
# include <iostream>
using namespace std;
int main()
{
int *const p = new int;
*p = 3;
cout<<"将3赋给p的地址后指针P读取的值\t"<<*p<<endl;
long *p1 = new long;
*p1 = 9999999;
cout<<"指针P的地址是\t"<<p<<endl;
cout<<"指针P1的地址是\t"<<p1<<endl;
cout<<"指针p1中的值\t"<<*p1<<endl;
*p = 23;
cout<<"指针p1中的值\t"<<*p1<<endl;
cout<<"指针p中的值\t"<<*p<<endl;
delete p;
delete p1;
return 0;
}