您的位置:首页 > 其它

MOOC清华《面向对象程序设计》第8章:悬挂指针实验

2017-09-18 18:33 344 查看
#include <iostream>
using namespace std;

int main(){
int* ptr1 = new int(1);
int* ptr2 = ptr1;

cout << *ptr1 << endl;
cout << *ptr2 << endl;

delete ptr1;

cout << *ptr2 << endl;

return 0;
}


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐