且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

那么,我们如何检查,如果一个指针是NULL指针?

更新时间:2023-11-28 10:37:40


  

我总是在想,如果只是(P!=
  NULL){..}将做的工作。


块引用>

它将。

I always think simply if(p != NULL){..} will do the job. But after reading this Stack Overflow question, it seems not.

So what's the canonical way to check for NULL pointers after absorbing all discussion in that question which says NULL pointers can have non-zero value?

I always think simply if(p != NULL){..} will do the job.

It will.