What does string::getline() do with the '\n' or other delimiter? Does it discard it? Leave it in the stream? Append it to the end of the string it reads in? Put it in it's hat and call it macaroni?
Thanks for the info.
What does string::getline() do with the '\n' or other delimiter? Does it discard it? Leave it in the stream? Append it to the end of the string it reads in? Put it in it's hat and call it macaroni?
Thanks for the info.
Last edited by A10; 10-31-2007 at 06:47 PM. Reason: Typo(s)
I'm pretty sure that it does nothing with it. It just reads until it finds the delimiting character, and then stops - it doesn't read it, no.
It discards the delimiter.
>> I'm pretty sure that it does nothing with it. It just reads until it finds the delimiting character, and then stops - it doesn't read it, no.
This is not correct. It reads until it finds the delimiter and adds the characters it finds to the string. It does not add the delimiter to the string, but it does remove it from the input buffer. The next time you read from the buffer the delimiter will not be there.