Quantcast
Channel: '\0' evaluates false, "\0" evaluates true - Stack Overflow
Viewing all articles
Browse latest Browse all 10

Answer by FedeWar for '\0' evaluates false, "\0" evaluates true

$
0
0

'\0' is a number: 0, so it is evaluated as false (0 = false, !0 = true).

But "\0" is a pointer to a read-only section where the actual string is stored, the pointer is not NULL ergo it's true.


Viewing all articles
Browse latest Browse all 10

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>