Different pointers point to the same area

int a = 10;
int* p1 = &a;
int* p2 = p1;

p1 = NULL;
*p2 = 0;

Different pointers point to the same area, when one of the pointers is killed, the thing pointed to by the other pointer will also disappear

Guess you like

Origin blog.csdn.net/cyy1104/article/details/130871725