This is probably a dumb question but if I have a C++ string as follows,
str = "the cat is black\n"
If I remove the last character, namely '\n', does this leave me with a null terminated string? Does the statement below work in creating a null terminated char * from the original string str?
char *c = str.erase(str.size()-1).c_str();