When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
26 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
\r\n is what happens when you press return
(enter)
CRLF
no
std::getline gets the newline character too i think
getline reads until and including a new line character basically
remove the last two characters from the string(not the null terminating character tho)
do you use std::string?
well then just do
.pop_back() twice if it really bothers you
or overload operator>> for Book in a way that it only stops when you hit a new line and doesn't stop at backspaces
Thank you and let us know if you have any more questions!
This thread is now set to auto-hide after an hour of inactivity
@deft narwhal
Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.
hmm weird
for me, it doesn't include the \r\n 
i hate strings and text in programming tho
you have to worry about encoding, newline difference, etc
@deft narwhal Has your question been resolved? If so, type !solved :)
yeah probably because std::cin throws away whitespaces or something like that
hmm, it is empty even with a file
vsc doesnt have anything to do with this tho
tho i set Visual studio to use LF, so my in.txt only has a \n at the end
int main() {
std::string line;
std::ifstream in("in.txt");
std::getline(in, line);
return 0;
}