C++: Avoiding random newlines while reading a random length string?
<p>While I was writing a programme in C++, I came across the following question: How to avoid random newlines while reading a random length string? I have a file (for example "data.txt") which is considered as a string and I want to extract and save the original string apart from the newline characters. Having used either the getline function or the >> operator, I didn't manage to get the proper string. The extraction stops if a newline character is reached. Any ideas?</p>
