Previously posted by Anthony Mai (this is the EXACT and COMPLETE post)
Paul asked: "try to memcpy a std::string into another. See what you'll get".
I tried already. It is your turn to try it, Paul. You will get exactly the
same result just as if you do a
Code:
std::string str1, str2;
str2 = "Just try it";
str2 = str1;
// Had you done memcpy(&str2, &str1, sizeof(str2));
// It will be the same.
I know this is a C++ forum. But whenever you say something doesn't work
in certain ways in C, and I know you are wrong. I have to stand out and
point out the obvious.
When you say you can't memcpy std::string, I have to show you that
you CAN, without an error. That does NOT mean I promote such usage.