Google News
logo
CPP - Quiz(MCQ)
What happens when a null pointer is converted into bool?
A)
the statement is ignored
B)
bool value evaluates to true
C)
an error is flagged
D)
bool value evaluates to false

Correct Answer :   bool value evaluates to false


Explanation : A pointer can be implicitly converted to a bool. A nonzero pointer converts to true and zero valued pointer converts to false.

Advertisement