What does ‘\0’ mean?
C++ std::strings are “counted” strings – i.e., their length is stored as an integer, and they can contain any character. When you replace the third character with a \0 nothing special happens – it’s printed as if it was any other character (in particular, your console simply ignores it). In the last line, instead, you are printing a … Read more