Should I expect that subsequent calls to myStr.length() should return the correct length? I ask because I'm using a compiler that doesn't seem to be doing this for me.
Thanks, Athar...but what do you mean by "undefined behavior?"
And, am I correct in assuming that if there were a "\r\n" appended to the "abcde" in the C string, then after the assignment, myStr.length() would be 7?
Thanks for the clarification. Turns out that this was cockpit error; in the same routine, I assigned myStr.c_str() to a character pointer, then manipulated the pointer. Guess that's not kosher. Now fixed.