std::string.c_str()
returns a (const char *) value. I Googled and found that I can do the following:
std::string myString = "Hello World";
char *buf = &myString[0];
How is this possible? &myString[0]
is an object of type std::string
, so how can this work?