28

不定项选择题 28 /66

下列关于bool,int,float,指针类型的变量a 与“零”的比较语句正确的有?

参考答案

bool : if(!a)
int : if(a == 0)
float: if(a == 0.0)
指针: if(a == nullptr)