#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;
}
#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;
}