<<< Pointer summary | Index | Pointer to character string >>> |
Consider
std::cout << "HELLO";
Literal "HELLO" is stored in memory as a sequence of bytes:
H | E | L | L | O | \0 |
String literals are said to be zero-terminated: the sequence is terminated by null character '\0'.
Programs can easily find the end of the string by looking for '\0'.
<<< Pointer summary | Index | Pointer to character string >>> |