---
title: "空指针的判断"
author: "rollstone"
date: "2011-10-11T17:43:07Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2011-10-11T17:43:07Z"
id: 1189923
url: "https://rollstone.iteye.com/blog/1189923"
---

请看NULL的定义： 
#if   !defined(__cplusplus) 
#define   NULL   ((void*)0) 
#else 
#define   NULL   0 
#endif 

if ( p != NULL )
if ( p != 0    )
if ( p )

c++教主推荐用0

http://bbs.51cto.com/thread-423115-1.html