Sail E0 Webinar
Question

What happens when a null pointer is converted into bool?


Options:
A .  An error is flagged
B .  bool value evaluates to true
C .  bool value evaluates to false
D .  the statement is ignored
Answer: Option C

A pointer can be implicitly converted to a bool. A nonzero pointer converts to true and zerovalued 

pointer converts to false.



Was this answer helpful ?

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers