Home » C++ Programming » Data Types » Question
  1. What happens when a null pointer is converted into bool?
    1. the statement is ignored
    2. bool value evaluates to false
    3. bool value evaluates to true
    4. an error is flagged
    5. None of these
Correct Option: B

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



Your comments will be displayed only after manual approval.