bool、int、float、指针变量a与0比较

//bool
if(!a)
if(a)

//int
if(a == 0)

//float
const EXP = 0.000001;
if(a < EXP && a > -EXP)

//pointer
if(a != NULL)
if(a == NULL)

 

posted @ 2016-08-29 11:14  绿水白川  阅读(968)  评论(0编辑  收藏  举报