Q:

Explain the behavior of the condition in the following if

0

 Explain the behavior of the condition in the following if:

const char *cp = "Hello World";
if (cp && *cp)

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

The condition `cp && *cp` means if `cp` is not a null pointer and the object pointed by `cp` is not null, 0 or can be converted to false.

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now