Is there any situation where the literal const char*
s ""
and "\0"
differ, or are they identical?
Edit: As requested that an edit should be added, the answer to this question was that an additional implicit '\0'
is added to "\0"
which already contains an explicit '\0'
. This is different from the char question which is concerned with string compairson
""
is 1 char,"\0"
is two chars.""
consists of two characters, while"\0"
consists of four. For that matter,"\0"
is also distinct from"\x00"
and"\000"
.