나는 가족의 연결된 목록이 있습니다. 나는 그런 형제 중 한 명을 삭제합니다.왜 포인터가 NULL이 아닌가요?
p->myWife->myChildren=p->myWife->myChildren->mySibling; //makes the sibling the child so the list is not broken when deleting
delete p->myWife->myChildren->mySibling;
나중에 내가 그래도 인쇄 할 때마다이
if(p->myWife->myChildren->mySibling!=NULL){
print the childs attributes
}
에 따라 자녀/형제 자매 속성을 인쇄는 어떻게해야합니까 (IM이에게 메모리 주소를 가정) 형제에 대한 이상한 번호를 인쇄 포인터를 null로 만들 필요가 있습니까?
페이지로 포인터를 설정합니다 http://stackoverflow.com/questions/704466/why-doesnt-delete-set-the-pointer-to-null –