void SLL_DestroyAllNodes1(Node **List)
{
Node *Head;
while(1)
{
Head = (*List)->NextNode;
if(Head ==NULL)
{
free(*List);
printf(\"*List = %d\\n\",*List);
break;
}
free(*List);
*List=Head;
}
}
분명히 free(*List)를 해줬는데도 밑에 printf해보면 값이 나오네요.. 어떻게 된 일이죠???
{
Node *Head;
while(1)
{
Head = (*List)->NextNode;
if(Head ==NULL)
{
free(*List);
printf(\"*List = %d\\n\",*List);
break;
}
free(*List);
*List=Head;
}
}
분명히 free(*List)를 해줬는데도 밑에 printf해보면 값이 나오네요.. 어떻게 된 일이죠???
그걸 떠나서 %d로 찍는게 ㅋ
코드가뭔가이상한데
malloc의 원리랄까 virtual memory의 원리랄까... 어디서부터 설명해야하나.....