天天看點

分别寫出BOOL,int , float,指針類型的變量a與“零”的比較語句

BOOL:
    if(a)  or  if(!a);
int:
    if(0 == a);
float:
    const float EXP = 0.000001;
    if(a<EXP && a>-EXP);
pointer:
    if(a != NULL)  or  if(a == NULL);