if语句直接用指针的判断出错

img
img

c++,不知道问题出在了哪里。
当我把判断语句的条件修改成指针时出现了预期意外的结果。判断语句改成pHead==NULL就可以了

PNODE pHead = (PNODE)malloc(sizeof(NODE));

if (pHead)//NULL ==pNode

{

    printf("内存分配失败!\n");


    exit(-1);
}

printf("%p\n", pHead);

if (pHead) 等价于:if(pHead != NULL)