I can\'t understand what the \'\\0\' in the two different place mean in the following code:
string x = \"hhhdef\\n\"; cout << x << endl; x[3]=\'\
\0 is the NULL character, you can find it in your ASCII table, it has the value 0.
\0
ASCII table
It is used to determinate the end of C-style strings.
However, C++ class std::string stores its size as an integer, and thus does not rely on it.
std::string